Render Show Page On Submit Backbone.js + Rails + Rails-backbone Gem
I am trying to setup my index.html.erb (root page) so that I can see two elements. A 'new post' form, and a 'new user' form. I am trying to get the forms' submit button to go to th
Solution 1:
Seems you have not correctly initialised your namespaces, you usually do:
window.Example=Views: {}
Models: {}
Routers: {}
And then you could have more namespaces, in your case, for Posts, in new_view.js.coffee
:
Example.Views.Posts ||= {}
class Example.Views.Posts.NewView ...
You could also define deeper namespaces in the first object I wrote:
window.Example=Views:Posts: {}
Users: {}
Models: {}
Routers: {}
In this case you won't have to write
Example.Views.Posts ||= {}
In your view.
If you are in Rails you could write this initialisation in your manifest application.js
, although I have read is not recommended to write code there, in case you opt for this, remember to include first application.js
//= require_self//= require_tree ./views
...
require_self
should be first.
Post a Comment for "Render Show Page On Submit Backbone.js + Rails + Rails-backbone Gem"