Class: Kidspire::Api::V1::FamiliesController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- Kidspire::Api::V1::FamiliesController
- Defined in:
- app/controllers/kidspire/api/v1/families_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
7 8 9 |
# File 'app/controllers/kidspire/api/v1/families_controller.rb', line 7 def show render json: FamilyBlueprint.render(current_family, view: :with_children) end |
#update ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/controllers/kidspire/api/v1/families_controller.rb', line 11 def update if current_family.update(family_params) render json: FamilyBlueprint.render(current_family, view: :with_children) else render json: { error: current_family.errors..first, code: "validation_error" }, status: :unprocessable_entity end end |