0

I'm working on a project that has a User Devise model and an Admin Devise model, and I want an Admin to be able to perform CRUD on the User model.

I've set up both Devise models following the Devise Wiki's How to Setup Multiple Devise User Models guide (including step 4 - exposing the scoped controllers).

This has given me the Devise views and controllers for confirmations, passwords, registrations, sessions and unlocks, but no users_controller to add CRUD actions to.

Could I simply create a users_controller and make sure it uses the correct users table in the database, or should I add CRUD actions to the registrations_controller?

Is the above advisable, or is there a more elegant way of setting up a CRUD interface for an Admin to be able to manage the User model?

Any help would be much appreciated.

1
  • You have all controller for CRUD of admin. right ? Commented Apr 10, 2018 at 4:06

1 Answer 1

1

Devise works only with sign_up/sign_in process. It assumes not only simple user creation, but some more things, like email sending. So if you want to create/update/destroy users you need to create separate UsersController. It is better to add an admin namespace to it

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.