I'm trying to use jQuery, and everything has been great, until now, when I'm trying to render a partial and append it to a div. Here is how I have it set up:
I have an action that responds to js:
def index
@objects = Object.find(:all)
respond_to do |format|
format.js
end
end
And a template called index.js.erb with some javascript in it:
alert("hello world");
Firebug returns a "text/javascript" response containing:
alert("hello world");
But the alert window does not appear, nor does any other JavaScript work. I checked out http://railscasts.com/episodes/136-jquery And am more or less following along. I tried several other things, like using .rjs instead of .erb and putting this in my template:
page.alert("hello world");
but I get the same exact result, and the browser never executes the JS.
Anyone know why the JavaScript isn't being executed?
I'm running Rails 2.3.4.