Example for Warden/Devise with an 'user' scope:
In config/initializers/rails_admin.rb
RailsAdmin.config do |config|
config.authenticate_with do
warden.authenticate! scope: :user
end
config.current_user_method(&:current_user)
endOr for an 'admin' scope:
In config/initializers/rails_admin.rb
RailsAdmin.config do |config|
config.authenticate_with do
warden.authenticate! scope: :admin
end
config.current_user_method(&:current_admin)
endRemember to add the routes for the scope you are working with:
devise_for :usersOr if you are using on :admin
devise_for :adminsCurrently there is a bug in devise heartcombo/devise#3321
It is recommended to copy the devise view and modify as the issue said. Fixed here: https://github.com/ryanmccarthypdx/retain_me/commit/b7534807c477f94c8d9a78d262513ad8c00d3623