Class: Spree::UserConfirmationsController
- Inherits:
-
Devise::ConfirmationsController
- Object
- Devise::ConfirmationsController
- Spree::UserConfirmationsController
- Includes:
- Core::ControllerHelpers::Auth, Core::ControllerHelpers::Common, Core::ControllerHelpers::Order, Core::ControllerHelpers::Store
- Defined in:
- app/controllers/spree/user_confirmations_controller.rb
Instance Method Summary collapse
-
#show {|resource| ... } ⇒ Object
GET /resource/confirmation?confirmation_token=abcdef.
Instance Method Details
#show {|resource| ... } ⇒ Object
GET /resource/confirmation?confirmation_token=abcdef
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/spree/user_confirmations_controller.rb', line 12 def show self.resource = resource_class.confirm_by_token(params[:confirmation_token]) yield resource if block_given? if resource.errors.empty? (:notice, :confirmed) (resource) do redirect_to after_confirmation_path_for(resource_name, resource) end elsif resource.confirmed? (:error, :already_confirmed) (resource) do redirect_to after_confirmation_path_for(resource_name, resource) end else (resource.errors, status: :unprocessable_entity) do render :new end end end |