Forum: Ruby on Rails layout

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0e92b0784ab5d0f2456728fd1909f918?d=identicon&s=25 Rodrigo Felix (Guest)
on 2009-05-04 03:40
(Received via mailing list)
I've been having a problem. I have an application layout and a users
controller. All the methods, but forgot_password, must use the
application
layout. So, I added below the class declaration the following line:

class UsersController < ApplicationController
    layout 'login', :only => [:forgot_password]

The problem is: if I write down that layout line, all methods but
forgot_password will have no layout. I cannot use render :layout =>
'forgot_password' into the forgot_password method because it already has
a
render call. I tried the following code it also didn't work.

class UsersController < ApplicationController
    layout 'login', :only => [:forgot_password]
    layout 'application', :except => [:forgot_password]

Does anybody have any suggestion to apply the login layout to the
forgot_password method and the application to the other ones? Thanks in
advance.

--
*Rodrigo Felix*
Web Developer
SCJP
1e54a6e4b02cb09900868728f8cb25d0?d=identicon&s=25 dwormuth (Guest)
on 2009-05-04 12:44
(Received via mailing list)
I think you need to move the layout statement into
the :forgot_password method. all the other methods will then use
application

On May 3, 9:39 pm, Rodrigo Felix <rodrigofelixdealme...@gmail.com>
This topic is locked and can not be replied to.