Created
November 21, 2013 01:12
-
-
Save boborchard/7574305 to your computer and use it in GitHub Desktop.
Use a different layout for Devise User Auth than standard template
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
class ApplicationController < ActionController::Base | |
layout :layout_by_resource | |
def layout_by_resource | |
# If user isn't signed in or is on the main devise controllers, we'll use a different layout | |
if devise_controller? && resource_name == :user && action_name == 'new' | |
"devise" | |
else | |
"application" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment