Back /front page question

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

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

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 <
[email protected]> wrote:

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit https://groups.google.com/groups/opt_out.


Regards by
Saravanan.P

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写道:

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:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs