Hello, Imaging I want to use another layout for show and one for edit and new. Must I then make two different application layouts with 2 css files or can I do that with 1 layout file and 1 css file ? Roelof -- 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 To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/1ad-M3PmyRwJ. For more options, visit https://groups.google.com/groups/opt_out.
hello, individual actions can render specific layouts. def show render(layout: "layouts/show") end def edit render(layout: "layouts/edit") end def new render(layout: "layouts/new") end but i dont know how to avoid double rendering -- 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 https://groups.google.com/groups/opt_out.
Just create admin.html.erb like application.html.erb under views/layouts/ And Just mentions in your controller which ever controller you need to use admin layout class TestController < InheritedResources::Base layout "admin" end On Thu, Oct 11, 2012 at 1:13 AM, Johann Christoph Gorzny < lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hello, > individual actions can render specific layouts. > > def show > render(layout: "layouts/show") > end > > def edit > render(layout: "layouts/edit") > end > > def new > render(layout: "layouts/new") > end > > but i dont know how to avoid double rendering > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- Regards by Saravanan.P -- 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 https://groups.google.com/groups/opt_out.
Or you can give a parameter from new.html.erb or edit.html.erb to _form.html.erb. In the _form.html.erb,check the parameter where it from and do the different things. 在 2012年10月11日星期四UTC+9上午3时29分40秒,roelof写道:> > Hello, > > Imaging I want to use another layout for show and one for edit and new. > Must I then make two different application layouts with 2 css files or can > I do that with 1 layout file and 1 css file ? > > Roelof > >-- 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@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/3rriuvdPOjgJ. For more options, visit https://groups.google.com/groups/opt_out.
Thanks for all the answers and solutions. Now see what will work for me. Roelof Op vrijdag 12 oktober 2012 10:40:00 UTC+2 schreef zhangjingqiang het volgende:> Or you can give a parameter from new.html.erb or edit.html.erb to > _form.html.erb. > In the _form.html.erb,check the parameter where it from and do the > different things. > > 在 2012年10月11日星期四UTC+9上午3时29分40秒,roelof写道: >> >> Hello, >> >> Imaging I want to use another layout for show and one for edit and new. >> Must I then make two different application layouts with 2 css files or >> can I do that with 1 layout file and 1 css file ? >> >> Roelof >> >> >-- 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@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/9UFmtFHljyEJ. For more options, visit https://groups.google.com/groups/opt_out.