Forum: Ruby on Rails how to use same lay out for two controllers?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
85c15595356c7d4e5d69ab33c03438dc?d=identicon&s=25 Sharma Chelluri (rubysharma)
on 2007-02-28 19:41

I have two controllers called user and languages. languages is generated
by scaffold. where user is created using rails generators. But user
controller is not using languages layout. how do I make user_controller
to use languages.rhtml as defualt layout.

Thanks in advance,
391f7ae8dd8c10dc323b7fbfe55b71a2?d=identicon&s=25 monki (Guest)
on 2007-02-28 20:50
(Received via mailing list)
You can specify a different layout to use in the controller.

So inside the user_controller add this line
layout 'languages'

and it should look in the layout folder for a languages.rhtml file.
Da94d619d42adc7a0fb294afd7b4e5fd?d=identicon&s=25 jstepper (Guest)
on 2007-02-28 23:06
(Received via mailing list)
put this at the top of your user_controller:

layout "languages"
85c15595356c7d4e5d69ab33c03438dc?d=identicon&s=25 Sharma Chelluri (rubysharma)
on 2007-03-01 05:45
Thank youguys. I need to observe keenly.
jstepper wrote:
> put this at the top of your user_controller:
> layout "languages"
This topic is locked and can not be replied to.