I use rails-backbone gem and I generated a Backbone model. The model includes paramRoot: attribute. I assume it somehow tells Backbone how to connect to the corresponding Rails model, but I can't find any documentation about it.
What does paramRoot actually do?
Backbone-rails doesn't document
paramRoot. I suppose you're supposed to use the generators to build your models:and blindly do as you're told.
If you want to know what it does then you have to read the source (as usual). The only thing in Backbone-rails that uses
paramRootis their replacement for the standardBackbone.sync; their replacement contains this:All that does is change a model's serialized attributes from the standard
{attr1: v1, attr2: v2, ...}Backbone form to the{ model_name: { attr1: v1, ... } }form that Rails wants; then you can look atparams[:model_name]in your Rails controllers rather than looking at justparams.