Todo = JSONRestModel.extend('todos')
To change the find url:
Todo = JSONRestModel.extend('todos',{
find_all_get_url: "application/todos.json"
},{}) Examples of how data should be returned to use JSONModel
// /recipes.json should return
[
{attributes:
{title: "Chicken Soup", id: "48",
instructions: "Call Mom!\nBring chicken",
id: 1} },
{attributes:
{title: "Toast", id: "49",
instructions: "Heat Bread",
id: 1} }
]
// /recipes/1.json should return
{attributes:
{title: "Chicken Soup", id: "48",
instructions: "Call Mom!\nBring chicken",
id: 1} } create_request(attributes) -> undefined
{Object} -
create_success(transport, callback, instance) -> jsonmodel
{Object} -
{Object} - success callback passed into create
{Object} - the instance this call is creating
{jsonmodel} - a new instance
destroy_delete_url(id) -> String
{Object} -
{String} - /plural_name/id.xml
find_all_get_success(transport) -> Array
{Object} -
{Array} - Array of json model instances that get passed to the callback
find_all_get_url() -> undefined
update_request(id, attributes) -> undefined
{Number} - the id of the instance we are updating
{Object} - updated attributes