Ruby on Rails has a lot of ways to generate JavaScript. Particularly when it comes to Ajax. Unfortunately, there are a few problems that I often see with the JavaScript that it generates.
Rails typically uses inline event handling.
<a onclick="somejavascript(); return false;" />
This is generally frowned upon, as it's mixing behavior in with the XHTML.
The generated JavaScript also relies heavily on Prototype. Personally, I prefer jQuery.
In my experience, the attitude with a lot of Rails developers has been to write as much of the code in Ruby as possible. The final step being to generate some very procedural and repetitive JavaScript. Often, this code ends up being very inflexible and difficult to debug.
So, my question is: how much JavaScript do you write manually for your projects and how much of it is generated server side with Rails/Ruby? Or is there a happy medium where you get the benefits of both? With a subquestion: if you write a lot of the JavaScript manually, what techniques do you use to fit it into the MVC model?