Hi, I think it should be simple but not working for me. class OneController < ApplicationController def first render :controller => ''two'', :action => ''first'' end end I want it to render using "/two/first.html.erb" but it still uses "/one/first.html.erb". Is :controller key not acceptable? Actually, I''m practicing restful resources. Models are like this: Message has many comments. I want new comment form to be in the message/show page instead of being separated on its own. If the comment is not validated in create action, it''s supposed to render message/show. But it didn''t work as I expected. Is it not allowed? If so, what''s the usual solution? Thanks. Sam -- 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 -~----------~----~----~----~------~----~------~--~---
Thorsten Mueller
2007-Dec-03 18:18 UTC
Re: Can I render a page using a template of another controll
render :template => "two/first.html.erb" works for me, maybe give it a try -- 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 -~----------~----~----~----~------~----~------~--~---
Sam Kong
2007-Dec-03 18:36 UTC
Re: Can I render a page using a template of another controll
Hi, Thorsten Mueller wrote:> render :template => "two/first.html.erb" > works for me, maybe give it a try:template works in rails 1.2.x. However, in rails edge, it''s always relative path whether I put a leading "/" or not. So I had to put "../" in front. Anyway, it works. Thank you very much. Sam -- 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 -~----------~----~----~----~------~----~------~--~---