I’m setting up a directory application for which I need to have two separate interfaces for the same Users table. Basically, administrators use the Users controller and views to list, edit, and add users, while non-admins need a separate interface which lists users in a completely different manner. To do this, would I be able to just set up another controller with different views but which accesses the Users model?
Sorry if this is a simple question, but I’ve had a hard time finding how to do this.
Why not put the admin part into a separate namespace – you would have
Admin::UsersControllerwith views inapp/views/admin/users/. And your users would go toUsersControllerwith its own views inapp/views/users/.The routing is defined like this:
And can be got to via
admin_users_pathandusers_path