How can I send JSON to the initialization of a model? I am trying to make the model dynamic based on a form:
v = new ModelObject($('#form-id').serializeJSON());
But this stores the form data as just one attribute and an object. I’d like to use the JSON attributes as the model attributes.
You’ll need to get a better serializer. I built one called Syphon, specifically to do this with backbone:
https://github.com/derickbailey/backbone.syphon
Or Ben Alman’s
serializeObjectjQuery extension: http://benalman.com/projects/jquery-misc-plugins/#serializeobject