Created
April 29, 2010 04:40
-
-
Save twe4ked/383150 to your computer and use it in GitHub Desktop.
One idea for giving devise's controllers their own layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to give your devise controllers all the same layout (e.g. "authentication" below) | |
class ApplicationController < ActionController::Base | |
layout :setup_layout | |
def setup_layout | |
return "authentication" if | |
[ConfirmationsController, PasswordsController, SessionsController, | |
RegistrationsController, UnlocksController].include? self.class | |
"application" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wouldn't that be cleaner?
the devise_controller? method is defined by devise, so why not use it.