On Mar 3, 1:40 am, Vladimir Prieto <[email protected]> wrote: > > even when it works, i must say that i find a little disorder. cuz, as i > said before, this JS code is more ralated to the "view". so, i really > think that this will be a better structure: > > app/views/posts/edit.html.erb > app/views/posts/new.html.erb > app/views/posts/edit.js > app/views/posts/new.js > > ¿is there an easy a way to make this structure? > ¿how and where i must include these js files? > ¿wich is the best rails practice for such a thing? > Rails doesn't really do much for you here - it's expecting js can be served out of the document root (ie the public folder) As far as I know you're pretty much on your own here. One way would be to have a rake task or similar that consolidates all of those small js files into a single all.js file which the user's browser can download and cache once and for all - only all.js would need to be in public/ javascripts
Fred > thanks... > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

