Class: QuoVadis::ConfirmationsController
- Inherits:
-
QuoVadisController
- Object
- ApplicationController
- QuoVadisController
- QuoVadis::ConfirmationsController
- Defined in:
- app/controllers/quo_vadis/confirmations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
send new confirmation email form submits here.
-
#edit ⇒ Object
emailed confirmation link points here.
- #edit_email ⇒ Object
-
#index ⇒ Object
holding page.
-
#new ⇒ Object
form for requesting new confirmation email.
- #resend ⇒ Object
-
#update ⇒ Object
confirm the account (and login).
- #update_email ⇒ Object
Instance Method Details
#create ⇒ Object
send new confirmation email form submits here
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 18 def create account = QuoVadis.find_account_by_identifier_in_params params unless account redirect_to new_confirmation_path, alert: QuoVadis.translate('flash.confirmation.identifier') and return end request_confirmation account.model redirect_to confirmations_path end |
#edit ⇒ Object
emailed confirmation link points here
31 32 33 34 35 36 37 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 31 def edit account = AccountConfirmationToken.find_account params[:token] unless account # expired or already confirmed redirect_to new_confirmation_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return end end |
#edit_email ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 58 def edit_email account = find_pending_account_from_session unless account redirect_to confirmations_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return end @email = account.model.email end |
#index ⇒ Object
holding page
7 8 9 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 7 def index @account = find_pending_account_from_session end |
#new ⇒ Object
form for requesting new confirmation email
13 14 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 13 def new end |
#resend ⇒ Object
83 84 85 86 87 88 89 90 91 92 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 83 def resend account = find_pending_account_from_session unless account redirect_to confirmations_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return end request_confirmation account.model redirect_to confirmations_path end |
#update ⇒ Object
confirm the account (and login)
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 41 def update account = AccountConfirmationToken.find_account params[:token] unless account # expired or already confirmed redirect_to new_confirmation_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return end account.confirmed! qv.log account, Log::ACCOUNT_CONFIRMATION session.delete :account_pending_confirmation login account.model, true redirect_to qv.path_after_signup, notice: QuoVadis.translate('flash.confirmation.confirmed') end |
#update_email ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'app/controllers/quo_vadis/confirmations_controller.rb', line 69 def update_email account = find_pending_account_from_session unless account redirect_to confirmations_path, alert: QuoVadis.translate('flash.confirmation.unknown') and return end account.model.update email: params[:email] request_confirmation account.model redirect_to confirmations_path end |