Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Devise

pencilcheck edited this page · 6 revisions

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)
end

Or 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)
end

Remember to add the routes for the scope you are working with:

devise_for :user

Or if you are using on :admin

devise_for :admin

Currently there is a bug in devise https://github.com/plataformatec/devise/issues/3321 It is recommended to copy the devise view and modify as the issue said.

Something went wrong with that request. Please try again.