Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing User Accounts with Rails 3 and Devise

I have implemented Devise in a Rails 3 application and I need admin users to be able to manage users. Users are not registerable and therefore an admin must create accounts. What would be the best way to go about this?

It doesn't seem very DRY to create my own UsersController when Devise already provides Devise::RegistrationController but I don't see any other options.

like image 909
Jim Mitchener Avatar asked Oct 07 '10 23:10

Jim Mitchener


1 Answers

I opted to create my own UsersController along side the RegistrationController. It really makes sense to have my own RESTful controller for admin purposes. It's not devise's job to manage user records and maintain administrative fields associated with them. It is, after all, an authentication framework. It just seems correct to leave it to do what it is designed for. You are required to create your own user model for a reason.

like image 167
Jim Mitchener Avatar answered Sep 20 '22 18:09

Jim Mitchener