I'm trying to have a collection in backbone that calls /search/:searchTerm
to the server upon fetch.
I have the following line:
this.collection.fetch({ data: {searchTerm: "user input"} });
Firebug tells me this leads to a GET http://localhost:4242/search?[object%20Object] Can this only be done by writing myself the ajax call in the backbone router, or is there a smoother faster way?
I had the same problem, but using jQuery.param seems to have fixed it, i.e.
this.collection.fetch({ data: jQuery.param({searchTerm: "user input"}) });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With