Rails_admin: admin subscription control

I set rails_admin first with the model name as rails_admin_user. When I first logged in, I clicked "Register" and created an administrator account. Now every time I want to log in; there is still a "Register" link.

It seems that anyone can create an account for the rails_admin admin interface.

If this is true, let me know how to limit the process of creating an admin user.

+4
source share
2 answers

Hey, this is how you do it. Navigate to your user or participant model, depending on how you configured the program, and remove it from the development attributes. Thus, the link will disappear.

+9
source

Late, but still nice to share, I think. You can do this to show the registration only for the first user, who I hope will be to you.

dev: logged if User.empty?

0
source

Source: https://habr.com/ru/post/1336448/


All Articles