Class: SystemTester::StairStepsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/system_tester/stair_steps_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
# File 'app/controllers/system_tester/stair_steps_controller.rb', line 6

def create
  stair_step = StairStep.new(stair_step_params)
  if stair_step.save
    render json: stair_step.to_json(stair_step_json_options)
  else
    render json: { errors: stair_step.errors }, status: :unprocessable_entity
  end
end

#destroyObject



24
25
26
27
# File 'app/controllers/system_tester/stair_steps_controller.rb', line 24

def destroy
  StairStep.find(params[:id]).destroy!
  render json: {}
end

#updateObject



15
16
17
18
19
20
21
22
# File 'app/controllers/system_tester/stair_steps_controller.rb', line 15

def update
  stair_step = StairStep.find(params[:id])
  if stair_step.update(stair_step_params)
    render json: stair_step.to_json(stair_step_json_options)
  else
    render json: { errors: stair_step.errors }, status: :unprocessable_entity
  end
end