I'm using the brunch-with-chaplinjs boilerplate with some additional libs (sinon, selenium, chai and mocha). Now i want to pass a model from a view, a collection-view to be exact, to another controller for editing.
I can do this like this:
Chaplin.utils.redirectTo 'editaddress', model:@model
But this makes my url messy:
localhost:8080/editaddress?model=%5Bobject%20Object%5D
I can not seem to find any acceptable way to keep the url clean and still pass the whole model to the other controller without refetching the model from the server.
Normally you would use chaplin's composer, but is only is for reusing views.
You can do this is still but with a stack.
Create a stack in
application.coffeethere you can store items while you change controller.Now you can push to your stack from anywhere in your code like this:
And to retrieve your can use: