Module: Devise::Controllers::InternalHelpers
- Extended by:
- ActiveSupport::Concern
- Includes:
- ScopedViews
- Included in:
- Devise::ConfirmationsController, PasswordsController, RegistrationsController, SessionsController, UnlocksController
- Defined in:
- lib/devise/controllers/internal_helpers.rb
Overview
Those helpers are used only inside Devise controllers and should not be included in ApplicationController since they all depend on the url being accessed.
Instance Method Summary collapse
-
#devise_controller? ⇒ Boolean
Overwrites devise_controller? to return true.
-
#devise_mapping ⇒ Object
Attempt to find the mapped route for devise based on request path.
-
#resource ⇒ Object
Gets the actual resource stored in the instance variable.
-
#resource_class ⇒ Object
Proxy to devise map class.
-
#resource_name ⇒ Object
(also: #scope_name)
Proxy to devise map name.
Instance Method Details
#devise_controller? ⇒ Boolean
Overwrites devise_controller? to return true
44 45 46 |
# File 'lib/devise/controllers/internal_helpers.rb', line 44 def devise_controller? true end |
#devise_mapping ⇒ Object
Attempt to find the mapped route for devise based on request path
39 40 41 |
# File 'lib/devise/controllers/internal_helpers.rb', line 39 def devise_mapping @devise_mapping ||= request.env["devise.mapping"] end |
#resource ⇒ Object
Gets the actual resource stored in the instance variable
23 24 25 |
# File 'lib/devise/controllers/internal_helpers.rb', line 23 def resource instance_variable_get(:"@#{resource_name}") end |
#resource_class ⇒ Object
Proxy to devise map class
34 35 36 |
# File 'lib/devise/controllers/internal_helpers.rb', line 34 def resource_class devise_mapping.to end |
#resource_name ⇒ Object Also known as: scope_name
Proxy to devise map name
28 29 30 |
# File 'lib/devise/controllers/internal_helpers.rb', line 28 def resource_name devise_mapping.name end |