If you're just looking for a better templating engine, why not try haml?
In haml, the following erb javascript
function test(blah) {
alert("<%= @application_name %> says " + blah);
}
could be re-written as:
function test(blah) {
alert("#{@application_name} says " + blah);
}
Since haml using the ruby string interpolation that we've all grown to know and love.
PS: One of the nice things about haml is that it can live right along side erb. Just install the gem, change the name of your application.erb.js to application.haml.js, and you should be all set.
PPS: Going this route will also open up the door to using haml in any of your views. Granted, some people do love ERb, but in my experience, using haml is orders of magnitude more readable and more fun.