I\'m trying to implement authentication with Devise in my Rails application (Rails 2.3.8, Devise 1.0.7, mongrel running on Windows Vista). But I\'m getting the following error:<
You can add helper methods to ApplicationHelper
. Make sure to use the proper model name (in my case it's :user
representing the User
model).
def devise_mapping
Devise.mappings[:user]
end
def resource_name
devise_mapping.name
end
def resource_class
devise_mapping.to
end
Update 1/28/2014
The master branch of Devise shows that devise_mapping
is now stored in the request:
# Attempt to find the mapped route for devise based on request path
def devise_mapping
@devise_mapping ||= request.env["devise.mapping"]
end
And resource_name
is aliased as scope_name
as well. See devise_controller.rb for more info.