How do I remove an active administrator link?

I don't want to sign the new user (admin admin), so I want to customize the active admin login page.

How to remove registration link from admin login page in active admin.

How can I do the same ??

+3


source to share


4 answers


The question is quite old, but I ran into the same problem. My decision:

mkdir -p app/views/active_admin/devise/shared
touch app/views/active_admin/devise/shared/_links.erb

      



I also disabled routes:

devise_for :users, ActiveAdmin::Devise.config.merge(skip: [:confirmations, :passwords, :registrations, :unlocks])

      

+5


source


If this rule applies to all of your admin pages, you can use a different layout file that did not include links (or a partial one that did include them.

You can set a variable in the controller (for example @hide_login

), then conditionally display them (for example <%= link_to("Sign Up", sign_up_path) unless @hide_login %>

)



I have worked on several applications where the admin interface is really a separate part of the application only accessible to internal users, in which case it might be useful to place your admin models / views / controllers in their own (e.g. Admin::ManageUsers

), which makes it easier to globally apply certain rules c before_filter

(including possibly defining a default layout).

0


source


There are several possibilities to do this, as you know you must have a controller (I mostly use AdminController) that has an index action.

then there is probably a partial render in the index view that displays the login / registration form

you can find the element that displays the registration link.

If you somehow can't find this, you can go to your terminal / CMD final type

grep -lr "sign-up" *

      

this will find the registration link somewhere and then just remove it or hide it as above.

0


source


thanks brother I also found this file and removed it from User calss ... I found my answer in AdminUser model where I just removed: registerable, from devise: database_authenticatable ,: recoverable ,: memorable ,: tracked ,: verifiable thank

0


source







All Articles