Skip to content

Instantly share code, notes, and snippets.

@yamamoto-febc
Created June 14, 2012 12:38
Show Gist options
  • Save yamamoto-febc/2930022 to your computer and use it in GitHub Desktop.
Save yamamoto-febc/2930022 to your computer and use it in GitHub Desktop.
JavaScriptMVC Introduction1 TestModel - POST Request
steal('jquery/model', function(){
/**
* @class Sample.Models.Hoge
* @parent index
* @inherits jQuery.Model
* Wraps backend hoge services.
*/
$.Model('Sample.Models.Hoge',
/* @Static */
{
findAll: "/hoges.json",
findOne : "/hoges/{id}.json",
create : "/hoges.json",
update : "POST /hoges/{id}.json",
destroy : "POST /hoges/{id}.json"
},
/* @Prototype */
{});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment