Depending on the kind of site you might want to use mvc views through
backbone or something similar and launch specific views depending on the
current page, something like so:

html:
body class=´users search_page´
...

and in your coffeescripts (you do use coffeescript :P)

class UserSearchView extends Backbone.View # or controller
   ...
  initialize: ->
    here goes your page specific initializers

$ ->
  window.currentView = new UserSearchView if $(´body.users.search').length >
0

I have never been a huge fan of libs like require.js except for real big web
apps, mostly it is better to just dump the whole javascript in one minified
file.


On Sun, May 29, 2011 at 5:41 AM, egervari <ken.egerv...@gmail.com> wrote:

> On May 29, 8:28 am, Gintautas Šimkus <dihita...@gmail.com> wrote:
> > If you see a lot of improvements that you personal would use in 3.1 over
> > 3.0.7, then you should think about switching. Another thing to consider
> is
> > deadlines, as upgrading will push the moment you are ready to go to
> > production further. You yourself raised a great question: will all the
> gems
> > work with the new version? If you are using few of them, you should check
> > that out before making the decision. Some projects use 50+ gems and then
> an
> > incompatible gem can bring considerable slowdown to development. Are you
> > willing to patch the gems/plugins yourself if they aren't compatible? My
> > personal opinion would be continue with development, and upgrade when the
> > project is on production, because then you'll be able to focus on 1 task
> -
> > upgrading, while if you migrate now, you will have to both keep
> developing
> > the functionality, and solve incompatability problems.
>
> All really good points. I am so early in development that upgrading
> turned out not to be a problem. Everything basically just worked.
> Sure, I had to remove/add configuration in various places... make a
> few directories... move some files... etc... but it all just worked.
>
> I think my only big question now concerns the javascript code - where
> do I put page-specific javascript? Since it all gets put into 1
> javascript file, where do I put my code for the individual pages? Or
> do I not worry about it? That seems a bit odd. Do I no longer need
> something like require.js?
>
> I'm just a little confused about how to go about this.
>
> --
> 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.
>
>

-- 
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.

Reply via email to