I am trying to combine Devise with a RESTful user resource using the following code in the routes.rb file:
resources :users, :only => [:index, :show]
devi
My advice in these situations is to check with rake routes
In routes the order in which routes are defined matters since earlier routes take precedence.
So in your case resources :users, :only => [:index, :show]
created a restfull /users/:id(.:format)
route that pointed to {:action=>"show", :controller=>"users"}
and when you went to Devise's sign up url /users/sign-up
it considered 'sign-up' an :id
of the user and naturally couldnt find it.
Now if you do the devise routing setup first, devise's routes take precedence over anything specified later and you get expected behaviour.
Yes, that's the right way to do it (see https://github.com/plataformatec/devise/wiki/How-To:-Manage-users-through-a-CRUD-interface)
In the link David Sulc wrote is shown that you should write a prefix to device_for or resources Example:
devise_for :users, :path_prefix => 'my'
resources :users
Or your users
devise_for :users
scope "/admin" do
resources :users
end
Both works well for me