Backbone.js and Rails - How to handle params from Backbone models?

前端 未结 6 2050
灰色年华
灰色年华 2021-02-01 18:38

In a standard Rails controller, I\'d create a record like this:

@user = User.new(params[:user])

This assumes that the form parameters that come

6条回答
  •  天涯浪人
    2021-02-01 19:04

    I have made a little hack to namespace save requests under model.name property. It monkey patches toJSON() during sync() call only and restores original method so you can use it as usual.

    I have implemented it in CoffeeScript.

    Check it here

提交回复
热议问题