Backbone model save

后端 未结 2 428
悲哀的现实
悲哀的现实 2021-01-03 08:30

I\'m using rails and learning Backbone.

Help me please. Is there any way to set right model on save? When I create, for example, new user with some params and trying

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 08:57

    The 'paramRoot' parameter is used by the backbone_rails_sync adapter that backbone-rails gem provides. That's why you can't find it in backbone's website.

    Another way, if you are not using the gem and it's adapter, is to render the user with :root => false

    render json: @user, root: false
    

提交回复
热议问题