1
votes

I'm new to rails and ActiveAdmin. I'm trying to create a sign up page for ActiveAdmin. First, I rails generate devise:views Second, I change my routes.rb:

# not devise_for :admin_users, ActiveAdmin::Devise.config  .
devise_for :admin_users 

However, I realized that my new created sign_up view (app/views/devise/registrations/new.html.erb) doesn't have a controller. The only controller that I have is app/controllers/concerns/application_controller.rb Here is my routes:

    new_admin_user_session GET        /admin/login(.:format)                  active_admin/devise/sessions#new
        admin_user_session POST       /admin/login(.:format)                  active_admin/devise/sessions#create
destroy_admin_user_session DELETE|GET /admin/logout(.:format)                 active_admin/devise/sessions#destroy
   new_admin_user_password GET        /admin/password/new(.:format)           active_admin/devise/passwords#new
  edit_admin_user_password GET        /admin/password/edit(.:format)          active_admin/devise/passwords#edit
       admin_user_password PATCH      /admin/password(.:format)               active_admin/devise/passwords#update
                           PUT        /admin/password(.:format)               active_admin/devise/passwords#update
                           POST       /admin/password(.:format)               active_admin/devise/passwords#create
                admin_root GET        /admin(.:format)                        admin/dashboard#index
...

How can I create a new route for admin_user sign up page that I can go localhost:3000/admins/sign_up.

1
Go through this link for better understanding github.com/plataformatec/devise/wiki/… - Mayur Shah

1 Answers

1
votes

You need to run

rails generate devise:controllers admins

and modify your routes.rb

devise_for :admins, path: 'admins', controllers: { sessions: "admins/sessions" }

for more info see this page

If you haven't already, I would recommend you set up the devise for users first.