Class: Api::V1::Scaffolding::CompletelyConcrete::TangibleThingsController

Inherits:
ApplicationController
  • Object
show all
Includes:
StrongParameters
Defined in:
app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb,
app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb

Defined Under Namespace

Modules: StrongParameters

Instance Method Summary collapse

Methods included from StrongParameters

#tangible_thing_params

Instance Method Details

#createObject

POST /api/v1/scaffolding/absolutely_abstract/creative_concepts/:absolutely_abstract_creative_concept_id/completely_concrete/tangible_things



18
19
20
21
22
23
24
# File 'app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb', line 18

def create
  if @tangible_thing.save
    render :show, status: :created, location: [:api, :v1, @tangible_thing]
  else
    render json: @tangible_thing.errors, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /api/v1/scaffolding/completely_concrete/tangible_things/:id



36
37
38
# File 'app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb', line 36

def destroy
  @tangible_thing.destroy
end

#indexObject

GET /api/v1/scaffolding/absolutely_abstract/creative_concepts/:absolutely_abstract_creative_concept_id/completely_concrete/tangible_things



10
11
# File 'app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb', line 10

def index
end

#showObject

GET /api/v1/scaffolding/completely_concrete/tangible_things/:id



14
15
# File 'app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb', line 14

def show
end

#updateObject

PATCH/PUT /api/v1/scaffolding/completely_concrete/tangible_things/:id



27
28
29
30
31
32
33
# File 'app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb', line 27

def update
  if @tangible_thing.update(tangible_thing_params)
    render :show
  else
    render json: @tangible_thing.errors, status: :unprocessable_entity
  end
end