Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
One idea for giving devise's controllers their own layout
# 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

This comment has been minimized.

Copy link

szajbus commented Apr 29, 2010

wouldn't that be cleaner?

def setup_layout
  devise_controller? ? "authentication" : "application"

the devise_controller? method is defined by devise, so why not use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.