Class: ApiGuard::RegistrationController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ApiGuard::RegistrationController
- Defined in:
- app/controllers/api_guard/registration_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/api_guard/registration_controller.rb', line 9 def create init_resource(sign_up_params) if resource.save create_token_and_set_header(resource, resource_name) render_success(message: I18n.t('api_guard.registration.signed_up')) else render_error(422, object: resource) end end |
#destroy ⇒ Object
19 20 21 22 |
# File 'app/controllers/api_guard/registration_controller.rb', line 19 def destroy current_resource.destroy render_success(message: I18n.t('api_guard.registration.account_deleted')) end |