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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-19 17:11 UTC
Re: ajax call not seen as a remote call; UJS in rails 2.3.8
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/634533I 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 TayagBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ramon Tayag
2010-Oct-19 17:15 UTC
Re: Re: ajax call not seen as a remote call; UJS in rails 2.3.8
On Wed, Oct 20, 2010 at 1:11 AM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> > > 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. :) Ramon Tayag -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.