Created
February 23, 2011 13:25
-
-
Save dannymcc/840426 to your computer and use it in GitHub Desktop.
Display different layouts depending on login state
This file contains hidden or 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 "another" | |
| # another way | |
| layout :another_by_method | |
| private | |
| def another_by_method | |
| if current_user.nil? | |
| "normal_layout" | |
| else | |
| "member_layout" | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment