Skip to content

Instantly share code, notes, and snippets.

@dannymcc
Created February 23, 2011 13:25
Show Gist options
  • Select an option

  • Save dannymcc/840426 to your computer and use it in GitHub Desktop.

Select an option

Save dannymcc/840426 to your computer and use it in GitHub Desktop.
Display different layouts depending on login state
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