Class: RiddlerAdmin::StepsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/riddler_admin/steps_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /steps



28
29
30
31
32
33
34
35
36
# File 'app/controllers/riddler_admin/steps_controller.rb', line 28

def create
  @step = @step_class.new(step_params)

  if @step.save
    redirect_to @step, notice: 'Step was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /steps/1



48
49
50
51
# File 'app/controllers/riddler_admin/steps_controller.rb', line 48

def destroy
  @step.destroy
  redirect_to steps_url, notice: 'Step was successfully destroyed.'
end

#editObject

GET /steps/1/edit



24
25
# File 'app/controllers/riddler_admin/steps_controller.rb', line 24

def edit
end

#indexObject

GET /steps



9
10
11
# File 'app/controllers/riddler_admin/steps_controller.rb', line 9

def index
  @steps = Step.all
end

#newObject

GET /steps/new



19
20
21
# File 'app/controllers/riddler_admin/steps_controller.rb', line 19

def new
  @step = Step.new
end

#showObject

GET /steps/1



14
15
16
# File 'app/controllers/riddler_admin/steps_controller.rb', line 14

def show
  step_definition = @step.definition_hash
end

#updateObject

PATCH/PUT /steps/1



39
40
41
42
43
44
45
# File 'app/controllers/riddler_admin/steps_controller.rb', line 39

def update
  if @step.update(step_params)
    redirect_to @step, notice: 'Step was successfully updated.'
  else
    render :edit
  end
end