use custom layout for devise controllers

This commit is contained in:
rgarcia
2015-08-06 16:01:01 +02:00
parent 44e049e483
commit 515d083633
2 changed files with 38 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base
respond_to :html
before_action :set_locale
layout :set_layout
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
@@ -22,8 +23,17 @@ class ApplicationController < ActionController::Base
I18n.locale = session[:locale]
end
def set_layout
if devise_controller?
"devise"
else
"application"
end
end
def verify_captcha?(resource)
return true unless recaptcha_keys?
verify_recaptcha(model: resource)
end
end