I’ve made a couple of other posts about this and finally figured out
what was
wrong. For some reason, the RJS response was not being sent with a
content
type of “text/javascript” (which it should be, per the dox). The
following
line in each controller method that renders RJS makes my app work:
@headers[‘Content-Type’] = ‘text/javascript’
Does anyone know why the content type might not be getting set
correctly?
I think I encountered this problem when I rendered some partials to a
string. That seems to set the content type, and subsequent renders
don’t fix it.
On Sunday, April 23, 2006, at 11:46 AM, s.ross wrote:
Thanks
View this message in context: http://www.nabble.com/
RJS-not-sent-as-text-javascript-t1495574.html#a4053568
Sent from the RubyOnRails Users forum at Nabble.com.
I’ve made a couple of other posts about this and finally figured out
what was
wrong. For some reason, the RJS response was not being sent with a
content
type of “text/javascript” (which it should be, per the dox). The
following
line in each controller method that renders RJS makes my app work:
@headers[‘Content-Type’] = ‘text/javascript’
Does anyone know why the content type might not be getting set
correctly?
It’s a pass-through and I’m at a loss to understand why the correct
header is
not being sent. I thought the :partial thing held some promise, but
reduced
it to render only the word ‘hello, rjs’ and that didn’t work with me
explicitly setting the headers.