I can't figure out how to add an 'index' action to the registrations
controller to be able to list all the users.
So I created a new controler as described in the WiKi:
```
#in app/controllers/users
class Users::RegistrationsController < Devise::RegistrationsController
before_filter :check_permissions, :only =>
[:new, :create, :cancel, :index]
skip_before_filter :require_no_authentication
def check_permissions
authorize! :create, resource
end
def index
@users = User.all
end
def edit
@user = User.find(
current_user.id)
end
def update
@user = User.find(
current_user.id)
params[:user].delete(:password) if params[:user][:password].blank?
params[:user].delete(:password_confirmation) if params[:user]
[:password].blank? and params[:user][:password_confirmation].blank?
if @user.update_attributes(params[:user])
flash[:notice] = "Successfully updated User."
redirect_to root_path
else
render :action => 'edit'
end
end
end
```
Then defined in routes.rb like that:
```
#routes.rb
devise_for :users, :controllers => { :registrations => "users/
registrations" } do
get 'users/list' => 'users/registrations#index', :as
=> :users_list
end
```
But when checking the available routes with rake routes, I don't see
the index root:
```
users_list GET /users/list(.:format) users/
registrations#index
new_user_session GET /users/sign_in(.:format) devise/
sessions#new
user_session POST /users/sign_in(.:format) devise/
sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/
sessions#destroy
user_password POST /users/password(.:format) devise/
passwords#create
new_user_password GET /users/password/new(.:format) devise/
passwords#new
edit_user_password GET /users/password/edit(.:format) devise/
passwords#edit
PUT /users/password(.:format) devise/
passwords#update
cancel_user_registration GET /users/cancel(.:format) users/
registrations#cancel
user_registration POST /users(.:format) users/
registrations#create
new_user_registration GET /users/sign_up(.:format) users/
registrations#new
edit_user_registration GET /users/edit(.:format) users/
registrations#edit
PUT /users(.:format) users/
registrations#update
DELETE /users(.:format) users/
registrations#destroy
```
What I did wrong? Thanks