Class: RiddlerAdmin::StepsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RiddlerAdmin::StepsController
- Defined in:
- app/controllers/riddler_admin/steps_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /steps.
-
#destroy ⇒ Object
DELETE /steps/1.
-
#edit ⇒ Object
GET /steps/1/edit.
-
#index ⇒ Object
GET /steps.
-
#new ⇒ Object
GET /steps/new.
-
#show ⇒ Object
GET /steps/1.
-
#update ⇒ Object
PATCH/PUT /steps/1.
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
GET /steps/1/edit
24 25 |
# File 'app/controllers/riddler_admin/steps_controller.rb', line 24 def edit end |
#index ⇒ Object
GET /steps
9 10 11 |
# File 'app/controllers/riddler_admin/steps_controller.rb', line 9 def index @steps = Step.all end |
#new ⇒ Object
GET /steps/new
19 20 21 |
# File 'app/controllers/riddler_admin/steps_controller.rb', line 19 def new @step = Step.new end |
#show ⇒ Object
GET /steps/1
14 15 16 |
# File 'app/controllers/riddler_admin/steps_controller.rb', line 14 def show step_definition = @step.definition_hash end |
#update ⇒ Object
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 |