I've googled around for a solution for this, but no luck.
I have a simple form. It submits to a controller. The controller
action passes through to an .rjs template. The page is updated and
all is well.
I wanted to disable the button because people were double submitting,
so I used:
:disable_with => 'Adding'
The button is disabled when I click on it.
However, my rjs now comes back as text and is rendered in the browser
instead of being rendered as page updates.
Content-Type: text/javascript; is correct, so the .rjs is being picked
up fine.
Any ideas on what to check next? I'm using Mongrel 1.0.1 with rails
1.2.3 (same error on 1.1.6, too).
It's not nearly as terse as your code, but it gets the job done and
may solve your issue. When I was getting the results you described, it
was because I had forgotted to add the
javascript_include_tag :defaults to my layout.