Class: PushType::ConfirmationsController

Inherits:
Devise::ConfirmationsController
  • Object
show all
Defined in:
app/controllers/push_type/confirmations_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
8
# File 'app/controllers/push_type/confirmations_controller.rb', line 5

def show
  self.resource = resource_class.find_by_confirmation_token params[:confirmation_token]
  super if resource.nil? or resource.confirmed?
end

#updateObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/push_type/confirmations_controller.rb', line 10

def update
  self.resource = resource_class.find_by_confirmation_token! user_params[:confirmation_token]
  resource.assign_attributes(user_params)

  if resource.valid?
    self.resource.confirm
    set_flash_message :notice, :confirmed
     resource_name, resource
  else
    render action: 'show'
  end
end