use custom layout for devise controllers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user