The goodness of unobtrusiveness really shows when the project turns big and you have all your code separated, it allows easy maintenance, debugging and updates, imaging having all your styles in the html and the having to change the site’s look, lots of potential to brake code just for changing a little thing, same with obtrusive js.
Well, you should never ever be writing ERb in your JavaScript like that.
JS files should IMHO always be static.
I've been looking at making a very JS heavy interface of late and it
actually requires replacing sections of the page with dynamic content.
Your take on it suggests that you could only ever return a static js
script, and therefore have no dynamic content. Is that right?
I lean more toward writing my JavaScript directly, at least with Rails
2. But RJS might be nice for calling certain Ajax actions.
The above examples merely do the same job with a cleaner syntax?
Just trying to take a look at best practices and gauge what I would
consider to be most appropriate.