Mk 27 wrote: > However, "getting the inline js" out will inevitably increase the actual > codebase of the project as whole, because you will have to add *more* > lines to your external scripts than you would have used in the page > source by inlining in *at least some* (if not quite a few) cases.
All I can say is that in the (non-Rails) project where I'm consistently using unobtrusive JS, this has not been my experience. It hasn't led to any more lines of code. This does in part depend on your HTML DOM being fairly well structured with good classes and id's. In my experience, once you learn how to do it right, it's no more lines of code to maintain, and forces you to have better-structured HTML to boot, which is an added advantage. But there is a bit of a learning curve, sure. Now, if you had to give up all the Rails helper methods (that are essentially dynamic js-code-generators), then THAT would lead to more code. I wouldn't want to do that. So I'm going to check out the UJS Rails plugin that Fred helpfully alerts us to. But to each her own. I was gonna try to look at your example to show you a short concise unobtrusive JS version that would do the same thing, but I don't understand the case quite well enough and don't feel like spending the time trying to just to make a point. But my experience leads me to be confident it would be possible. -- Posted via http://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 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 -~----------~----~----~----~------~----~------~--~---