Solved: RJS Templates Not automatically evaluating

I had posted a question here and on IRC about an issue I had with RJS
templates not automatically evaluating (I had to put my own
eval(response.responseText) in an :complete).

The issue was that the content type was not being set to
text/javascript, because I was explicitly setting content-type in a
before_filter in my application.rb. I had put that line in a long time
ago to make validator.org like my xhtml strict and forgotten about it,
and didn’t quite realize how the auto-evaluation magic of prototype
worked (and still don’t to be honest).

I guess I am a little confused why the content-type wouldn’t be
overwritten when the template is rendered but I won’t worry about it.
Maybe this will help someone else.


Jeremy H.
http://www.jeremyhuffman.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs