Class: SystemTester::ScenarioStepsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  scenario_step = ScenarioStep.new(scenario_step_params)
  if scenario_step.save
    render json: scenario_step.to_json(scenario_step_json_options)
  else
    render json: { errors: scenario_step.errors }, status: :unprocessable_entity
  end
end

#destroyObject



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

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

#updateObject



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

def update
  scenario_step = ScenarioStep.find(params[:id])
  if scenario_step.update(scenario_step_params)
    render json: scenario_step.to_json(scenario_step_json_options)
  else
    render json: { errors: scenario_step.errors }, status: :unprocessable_entity
  end
end