Forum: Ruby on Rails back /front page question

Posted by Roelof Wobben (roelof)
on 2012-10-10 20:30
(Received via mailing list)
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
Posted by Johann Christoph Gorzny (johchri)
on 2012-10-10 21:43
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 by Saravanan P (Guest)
on 2012-10-11 17:33
(Received via mailing list)
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@ruby-forum.com> wrote:

>
> 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@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


--
Regards by
Saravanan.P
Posted by Jingqiang Zhang (zhangjingqiang)
on 2012-10-12 10:40
(Received via mailing list)
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写道:
Posted by Roelof Wobben (roelof)
on 2012-10-12 10:59
(Received via mailing list)
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:
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.