Class: Devise::CertificationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Devise::CertificationsController
- Includes:
- Devise::Controllers::InternalHelpers
- Defined in:
- app/controllers/devise/certifications_controller.rb
Instance Method Summary collapse
-
#edit ⇒ Object
GET /resource/certification/edit?certification_token=abcdef.
-
#update ⇒ Object
PUT /resource/certification.
Instance Method Details
#edit ⇒ Object
GET /resource/certification/edit?certification_token=abcdef
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/devise/certifications_controller.rb', line 6 def edit self.resource = resource_class.find_resource_by_token(params[:certification_token]) if resource.errors.empty? render_with_scope :edit else (:alert, :certification_token_invalid) redirect_to self.resource end end |
#update ⇒ Object
PUT /resource/certification
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/devise/certifications_controller.rb', line 18 def update self.resource = resource_class.certify_by_token(params[resource_name][:certification_token], current_certifier) params[resource_name].delete(:certification_token) self.resource.update_attributes(params[resource_name]) if resource.errors.empty? :notice, :certified redirect_to self.resource else render_with_scope :edit end end |