I''m on EdgeRails, and I can''t seem to get .rjs files to be used automatically. I''ve looked at Cody''s (and others) tutorials, and I always have to say ".rjs", even when it''s the only one there! For example: def show format.html { render :action => ''show.rjs'' } # notice explicit ".rjs" end Instead of: def show format.html { render :action => ''show'' } end Anyone get this working? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nate wrote:> I can''t seem to get .rjs files to be used > automatically.<snip>> Anyone get this working?Absolutely. Have you deleted the other files? There''s a hirrarchy. Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes, I''ve deleted the other files: $ ls -1 edit.rhtml index.rhtml new.rhtml show.rjs show.rjs is the only one available for the show action --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Got it: You have to put this in a format.js under EdgeRails: def show @user_role = UserRole.find(params[:id]) respond_to do |format| format.js { render :action => ''show'' } format.html { raise "AJAX only for this action" } format.xml { render :xml => @user_role.to_xml } end end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nah, nevermind - that fixed the updating problem, but I still have to say ".rjs" respond_to do |format| format.js { render :action => ''show.rjs'' } format.html { raise "AJAX only for this action" } format.xml { head :ok } end Any ideas?? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nate wrote:> Nah, nevermind - that fixed the updating problem, but I still have to > say ".rjs" > > respond_to do |format| > format.js { render :action => ''show.rjs'' } > format.html { raise "AJAX only for this action" } > format.xml { head :ok } > end > > Any ideas??try this: def show respond_to do |format| format.js format.html { raise "AJAX only for this action" } format.xml { head :ok } end end Also, make sure you are using link_to_remote, form_remote_tag or some other Ajax serialization method in the view that launches this method, otherwise the form is going to set the content type to html instead of JS. Can you paste the view thatis calling this method and the show.rjs that you are using? --jake -- 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 -~----------~----~----~----~------~----~------~--~---
Thanks Jake, I had resolved this already. For some reason, I just needed to restart WEBrick. Must''ve had something cached internally. It is working just like the example you show above. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---