Class: AuthHelpers::Controller::Confirmable
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- AuthHelpers::Controller::Confirmable
- Includes:
- Helpers, InheritedResources::BaseHelpers
- Defined in:
- lib/auth_helpers/controller/confirmable.rb
Instance Method Summary collapse
-
#create(options = {}, &block) ⇒ Object
(also: #create!)
POST /account/confirmation POST /account/confirmation.xml.
-
#new(&block) ⇒ Object
(also: #new!)
GET /account/confirmation/new.
-
#show(options = {}, &block) ⇒ Object
(also: #show!)
GET /account/confirmation?account=xxxx POST /account/confirmation.xml?account=xxxx.
Methods included from Helpers
Instance Method Details
#create(options = {}, &block) ⇒ Object Also known as: create!
POST /account/confirmation POST /account/confirmation.xml
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/auth_helpers/controller/confirmable.rb', line 22 def create(={}, &block) object = get_or_set_with_send(:find_and_resend_confirmation_instructions, params[self.instance_name]) if object.errors.empty? (:notice, 'We sent confirmation instructions to your email, please check your inbox.') respond_with_dual_blocks(object, , true, block) do |format| format.html { redirect_to([:location] || url_by_name_and_scope(:session)) } end else (:error) respond_with_dual_blocks(object, , false, block) end end |
#new(&block) ⇒ Object Also known as: new!
GET /account/confirmation/new
14 15 16 17 |
# File 'lib/auth_helpers/controller/confirmable.rb', line 14 def new(&block) object = get_or_set_with_send(:new) respond_with(object, &block) end |
#show(options = {}, &block) ⇒ Object Also known as: show!
GET /account/confirmation?account=xxxx POST /account/confirmation.xml?account=xxxx
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/auth_helpers/controller/confirmable.rb', line 39 def show(={}, &block) object = get_or_set_with_send(:find_and_confirm, params[self.instance_name]) if object.errors.empty? (:notice, '{{resource_name}} was successfully confirmed.') respond_with_dual_blocks(object, , true, block) do |format| format.html { redirect_to([:location] || url_by_name_and_scope(:session)) } end else (:error, object.errors.on(:perishable_token)) respond_with_dual_blocks(object, , false, block) do |format| format.html { render :action => "new" } end end end |