Skip to content

Commit

Permalink
Merge pull request #127 from robinboening/layout_configuration
Browse files Browse the repository at this point in the history
Allow setting a layout for user_sessions and passwords controller
  • Loading branch information
tvdeyen authored Feb 29, 2024
2 parents 874cece + c25e338 commit 8ebd445
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/alchemy/admin/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PasswordsController < ::Devise::PasswordsController

helper "Alchemy::Admin::Base"

layout "alchemy/admin"
layout Alchemy::Devise.layout

private

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/alchemy/admin/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UserSessionsController < ::Devise::SessionsController

helper "Alchemy::Admin::Base"

layout "alchemy/admin"
layout Alchemy::Devise.layout

def create
authenticate_user!
Expand Down
7 changes: 7 additions & 0 deletions lib/alchemy/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@ def self.devise_modules
end

module Devise
def self.layout=(value)
@layout = value
end

def self.layout
@layout || "alchemy/admin"
end
end
end

0 comments on commit 8ebd445

Please sign in to comment.