I have a Game model and I want to mass assign on create:
def create
game = Game.new(params[:game])
...
end
But Backbone sends model attributes without wrapping them in 'game' param, and I have to do this:
def create
game = Game.new(:title=>params[:title], ... )
...
end
I want my controller clean, how to use mass assignment with Backbone.js?
Answer From Backbone creator: http://www.quora.com/How-well-does-backbone-js-work-with-rails
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With