Class: SystemTester::StairStepsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- SystemTester::StairStepsController
- Defined in:
- app/controllers/system_tester/stair_steps_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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() else render json: { errors: stair_step.errors }, status: :unprocessable_entity end end |
#destroy ⇒ Object
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 |
#update ⇒ Object
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() else render json: { errors: stair_step.errors }, status: :unprocessable_entity end end |