Class: Kidsmin::Api::V1::FamiliesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/kidsmin/api/v1/families_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



7
8
9
# File 'app/controllers/kidsmin/api/v1/families_controller.rb', line 7

def show
  render json: FamilyBlueprint.render(current_family, view: :with_children)
end

#updateObject



11
12
13
14
15
16
17
18
# File 'app/controllers/kidsmin/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.full_messages.first, code: "validation_error" },
           status: :unprocessable_entity
  end
end