respond_to do |format| format.html format.js { render :template => "login" } end Whenever I send an AJAX request to the action that has that code it says it cant find the template login.js. Why isnt it looking for login.rjs? Also when I take out the render it serves up the rhtml template instead of the rjs template. Any idea why this is? I am using edge rails and the latest version of mongrel. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 6, 2008 8:09 PM, Ben Johnson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > respond_to do |format| > format.html > format.js { render :template => "login" } > end > > Whenever I send an AJAX request to the action that has that code it says > it cant find the template login.js. Why isnt it looking for login.rjs? > Also when I take out the render it serves up the rhtml template instead > of the rjs template. Any idea why this is? I am using edge rails and the > latest version of mongrel. > -- > Posted via http://www.ruby-forum.com/. > > > >Try render :partial => "login" render :template assumes a full page redraw. Jason --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
An AJAX request is NOT a javascript request, it''s a HTML request. You''ll need to request the js by suffixing it with .js. http://url/login.js --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Actually Ryan, AJAX is a javascript request (Async Javascript And XML). I use format.js quite extensively in one of my projects to differentiate from local AJAX and external XML requests. Jason On Jan 6, 2008 8:37 PM, Ryan Bigg <radarlistener-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> An AJAX request is NOT a javascript request, it''s a HTML request. You''ll > need to request the js by suffixing it with .js. > > http://url/login.js > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- Rails 2.0.2 + RJS
- Problem with RJS and/or Prototype.js =>ResponseText is blank
- padawan seeks advice from jedi masters to create toggle box via ajax/rjs before slitting wrists with ruby powered light-saber.
- Highlighint rjs problem on a new product
- RJS and Greybox : executing the js in the parent window?