Class: ConfirmationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ConfirmationsController
- Includes:
- Devise::Controllers::Helpers
- Defined in:
- app/controllers/confirmations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /resource/confirmation.
-
#new ⇒ Object
GET /resource/confirmation/new.
-
#show ⇒ Object
GET /resource/confirmation?confirmation_token=abcdef.
Methods included from Devise::Controllers::Helpers
#devise_controller?, #devise_mapping, included, #resource, #resource_class, #resource_name
Instance Method Details
#create ⇒ Object
POST /resource/confirmation
10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/confirmations_controller.rb', line 10 def create self.resource = resource_class.send_confirmation_instructions(params[resource_name]) if resource.errors.empty? :success, :send_instructions redirect_to new_session_path(resource_name) else render :new end end |
#new ⇒ Object
GET /resource/confirmation/new
5 6 7 |
# File 'app/controllers/confirmations_controller.rb', line 5 def new build_resource end |
#show ⇒ Object
GET /resource/confirmation?confirmation_token=abcdef
22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/confirmations_controller.rb', line 22 def show self.resource = resource_class.confirm!(:confirmation_token => params[:confirmation_token]) if resource.errors.empty? sign_in(resource_name, resource) :success, :confirmed redirect_to home_or_root_path else render :new end end |