I\'m using Devise in a Rails 3 app, but in this case, a user must be created by an existing user, who determines what permissions he/she will have.
Because of this, I
I liked @max's answer, but when trying to use it I ran into an error due to devise_mapping
being nil.
I modified his solution slightly to one that seems to address the issue. It required wrapping the call to resource
inside devise_scope
.
devise_for :users, skip: [:registrations]
devise_scope :user do
resource :users,
only: [:edit, :update, :destroy],
controller: 'devise/registrations',
as: :user_registration do
get 'cancel'
end
end
Note that devise_scope
expects the singular :user
whereas resource
expects the plural :users
.