Eduardo Dmz
2006-Nov-12 05:04 UTC
how to correctly render a .rxml template for respond_to ?
''m using resources. I have two templates for the show action (show.rhtml and show.rxml). If I specify the format in the URL (/posts/1.xml) the show.rxml templates gets rendered with the current layout. Problem would be solved if I could disable the layout for a specific format, but seems that its not possible. Any ideas ? My app needs more than just: format.xml { render :xml => @post.to_xml } thats why I need to have a show.rxml template. Thanks in advance. -- 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 -~----------~----~----~----~------~----~------~--~---
Ingo Weiss
2006-Dec-31 16:28 UTC
Re: how to correctly render a .rxml template for respond_to
Hi Eduardo, I am having the same problem - did you find a solution to this? Ingo Eduardo Dmz wrote:> ''m using resources. > > I have two templates for the show action (show.rhtml and show.rxml). > > If I specify the format in the URL (/posts/1.xml) the show.rxml > templates gets rendered with the current layout. Problem would be solved > if I could disable the layout for a specific format, but seems that its > not possible. > > Any ideas ? > > My app needs more than just: > > format.xml { render :xml => @post.to_xml } > > thats why I need to have a show.rxml template. > > Thanks in advance.-- 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 -~----------~----~----~----~------~----~------~--~---
ryan.raaum-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Dec-31 19:28 UTC
Re: how to correctly render a .rxml template for respond_to ?
On Nov 12, 12:04 am, Eduardo Dmz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> ''m using resources. > > I have two templates for the show action (show.rhtml and show.rxml). > > If I specify the format in the URL (/posts/1.xml) the show.rxml > templates gets rendered with the current layout. Problem would be solved > if I could disable the layout for a specific format, but seems that its > not possible.how about? def show # show method contents here respond_to do |format| format.html format.xml { render :action => "show.rxml", :layout => false } end end Best, -r> > Any ideas ? > > My app needs more than just: > > format.xml { render :xml => @post.to_xml } > > thats why I need to have a show.rxml template. > > Thanks in advance. > > -- > Posted viahttp://www.ruby-forum.com/.-- Ryan Raaum http://raaum.org http://rails.raaum.org -- Rails docs http://locomotive.raaum.org -- Self contained Rails for Mac OS X --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---