>class UserSearchView extends Backbone.View # or controller > ... > initialize: -> > here goes your page specific initializers > >$ -> > window.currentView = new UserSearchView if $(´body.users.search').length > >0
This solution looks interesting, and it also looks potentially dangerous. I'm not a fan of string-based rules like this. I guess I can just get used to it (and of course not rely on the body, but perhaps a <div id="user_search"> or something like that. I will play with it. It might be nice to never have to care to include the script tag at the bottom of page, using require or not. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.