I'm currently trying to wrap my head around the backbone.js vaccination in my rails application. First, I want to create it in a specific part of the rails application in / application. With that said, I have a resource resource "resources: applications", which gives me localhost: 3000 / applications. Now, when I create the basis for / applications, I get anchor tags for trunk routing on this rail resource. IE localhost: 3000 / applications / # applications / 5.
Given that I'm going to use the backbone in certain parts of the rails application, so without making it a single-page application, is this the right way to do something? The url looks a bit redundant.
The correct answer may be that I need to do away with the trunk router? If so, how is it possible: id to be transferred to the base application when trying to search for a collection / model.
A point using the trunk will help organize a specific section of the rails application, which will be heavy javascript.
I should mention that I can change the router to something like:
routes: '': 'index' ':id': 'show'
which will give me the localhost url: 3000 / applications / # / 1 - however I think that it paints me in the corner and will not allow me to use the trunk on other rail resources. If I had localhost: 3000 / dashboard with the called base, then the incorrect function backbone.js will be executed.
Another thought would be to call a reverse router on each rails resource. I could use the above route code, since the router will only be called for this rails resource.
source share