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
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/api_guard/registration_controller.rb', line 7 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
17 18 19 20 |
# File 'app/controllers/api_guard/registration_controller.rb', line 17 def destroy current_resource.destroy render_success(message: I18n.t('api_guard.registration.account_deleted')) end |