I would like to use Devise to log in regular non-admin users with the same User model. So I used role id as another attribute and everything working fine. The challenge is that I have to create the custom login page, registration page and other related pages for front-end user. The current route file is:
Rails.application.routes.draw do
devise_for :users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
end
Since I want to generate the new login form and want to override the controller I add devise_for :users but it gives me an error route is defined. How could I resolve the conflict?
Also, below is active admin setting:
config.authentication_method = :authenticate_user!
config.current_user_method = :current_user
I want to customize login page and sign up page controller because I have to add few things to signup form.
You can override ActiveAdmin in the active_admin.rb
config to use the same User
model you're using in your application:
So if your primary devise scope is user
:
In active_admin.rb
ActiveAdmin.setup do |config|
# ...
config.authentication_method = :authenticate_user!
config.current_user_method = :current_user
# ...
http://activeadmin.info/docs/1-general-configuration.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With