ajax call not seen as a remote call; UJS in rails 2.3.8

I’ve applied ujs in rails 2.3.8 (I followed http://andrewcox.org/post/507032751/rails-3-0-unobtrusive-ajax-in-rails-2-3-x) and the controller, when answering the ajax call, seems to render show.html.haml, not show.js.erb. What can I do to make the ajax call be seen as a “remote” call? Take a look at lines 13-19.

http://gist.github.com/634533

Thanks,
Ramon Tayag

Ramon Tayag wrote in post #955501:

I've applied ujs in rails 2.3.8 (I followed
http://andrewcox.org/post/507032751/rails-3-0-unobtrusive-ajax-in-rails-2-3-x)
and the controller, when answering the ajax call, seems to render
show.html.haml, not show.js.erb. What can I do to make the ajax call be
seen
as a "remote" call? Take a look at lines 13-19.

http://gist.github.com/634533

I believe that your Ajax call would have to request the JavaScript MIME
type.

But don't do this. js.erb should IMHO always be seen as a design
problem. Use static JavaScript files that read dynamic content from the
DOM.

Thanks,
Ramon Tayag

Best,

I believe that your Ajax call would have to request the JavaScript MIME

type.

Thanks Marnen.

But don’t do this. js.erb should IMHO always be seen as a design

problem. Use static JavaScript files that read dynamic content from the

DOM.

That’s definitely different from the way I’ve been learning. It’s a bit late, so I’ll sleep on it and research about this being a design problem. :slight_smile:

Ramon Tayag