Class: SystemTester::StepsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- SystemTester::StepsController
- Defined in:
- app/controllers/system_tester/steps_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/controllers/system_tester/steps_controller.rb', line 17 def create step = Step.new(step_params) if step.save render json: step.to_json() else render json: { errors: step.errors }, status: :unprocessable_entity end end |
#destroy ⇒ Object
35 36 37 38 |
# File 'app/controllers/system_tester/steps_controller.rb', line 35 def destroy Step.find(params[:id]).destroy! render json: {} end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/system_tester/steps_controller.rb', line 5 def index render json: Step.all.to_json() end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/system_tester/steps_controller.rb', line 13 def new render json: Step.new(step_params).to_json() end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/system_tester/steps_controller.rb', line 9 def show render json: Step.find(params[:id]).to_json() end |
#update ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/system_tester/steps_controller.rb', line 26 def update step = Step.find(params[:id]) if step.update(step_params) render json: step.to_json() else render json: { errors: step.errors }, status: :unprocessable_entity end end |