mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-27 01:11:37 +01:00
Fix #611 - Layout setting in registrations controller
This commit is contained in:
parent
aa1213e089
commit
d96e031dfc
1 changed files with 7 additions and 2 deletions
|
@ -1,8 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Auth::RegistrationsController < Devise::RegistrationsController
|
||||
layout 'auth'
|
||||
layout 'admin', only: [:edit]
|
||||
layout :determine_layout
|
||||
|
||||
before_action :check_single_user_mode
|
||||
before_action :configure_sign_up_params, only: [:create]
|
||||
|
@ -31,4 +30,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
|||
def check_single_user_mode
|
||||
redirect_to root_path if Rails.configuration.x.single_user_mode
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def determine_layout
|
||||
%w(edit update).include?(action_name) ? 'admin' : 'auth'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue