Reputation: 159
I don't want to sign-up new user to (active admin) admin panel..so that I want to customize the login page of active admin.
How can I remove the sign-up link from the admin-login page in active admin.
How can I do the same...?
Upvotes: 4
Views: 1706
Reputation: 1351
The question is quite old, but I just came across the same problem. My solution is:
mkdir -p app/views/active_admin/devise/shared
touch app/views/active_admin/devise/shared/_links.erb
I have also disabled the routes:
devise_for :users, ActiveAdmin::Devise.config.merge(skip: [:confirmations, :passwords, :registrations, :unlocks])
Upvotes: 7
Reputation: 2020
There are several posibilities to do this as you know you should have a controller (I mostly use AdminController) wich has an index action.
then in de index view there probably is a render partial wich renders the login/sign-up form
you can locate the elemement wich renders the sign-up link.
If you somehow can't find this you can go to your Terminal/CMD end type
grep -lr "sign-up" *
this will find the sign-up link somewhere then just delete it or hide it like above message suggests
Upvotes: 0
Reputation: 14028
If this rule applies to all of your admin pages, you could use a different layout file that didn't include the links (or the partial that included them.
You could set a variable in the controller (e.g. @hide_login
) then conditionally display them (e.g. <%= link_to("Sign Up", sign_up_path) unless @hide_login %>
)
I have worked on a number of applications where the admin interface is really a separate part of the app, accessible only to internal users, and in this case it can be helpful to put your administrative models/views/controllers in their own namespace ( e.g. Admin::ManageUsers
) which makes it easy to globally apply certain rules in a before_filter
(including, possibly defining the default layout).
Upvotes: 0