I'm trying to send an object from Backbone.js to my Rails backend. Currently when I call save()
on my model, it sends this to the server:
{"program_id":1,"issuer_id":4}
But Rails is expecting it in the following format:
{"program_issuer_link":{"program_id":1,"issuer_id":4}}
Is there any way I can do this encapsulation to the JSON object that gets sent from Backbone.js to Rails when I call save()
on my model? I've looked through the documentation but couldn't find anything about it.