How do I remove an active administrator link?
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])
source to share
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).
source to share
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.
source to share