How can I have a completely different layout depending on wether a user is logged in or not?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Follow the instructions at
https://github.com/plataformatec/devise/wiki/How-To%3a-Create-custom-layouts
and make the check be if the user is logged in, which for devise means checking
user_signed_in?, which is a devise helper.Specifically:
and put the
special_layout_for_logged_in.html.erbview file in the layouts directory.