Skip to content

Instantly share code, notes, and snippets.

View jeffmess's full-sized avatar
🧑‍🍳

jeffmess

🧑‍🍳
  • Cloud Assess
  • Sunshine Coast, Australia
View GitHub Profile
@jeffmess
jeffmess / backbone-rails.js
Created July 26, 2011 13:16
Alias Backbone.sync method to inject Rails specific parameters
_.extend(Backbone.Model.prototype, {
// By default, rails expects model params to be wrapped in a nested params hash
// https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/params_wrapper.rb
_paramsWrapper : function() {
return this.paramsWrapper;
}
});
// Alias Backbone.sync method to inject Rails specific