Class: Wf::PlacesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Wf::PlacesController
- Defined in:
- app/controllers/wf/places_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/wf/places_controller.rb', line 14 def create @workflow = Wf::Workflow.find(params[:workflow_id]) @place = @workflow.places.new(place_params) if @place.save redirect_to workflow_path(@workflow), notice: "place was successfully created." else render :new end end |
#destroy ⇒ Object
24 25 26 27 28 29 |
# File 'app/controllers/wf/places_controller.rb', line 24 def destroy @workflow = Wf::Workflow.find(params[:workflow_id]) @place = @workflow.places.find(params[:id]) @place.destroy render js: "window.location.reload()" end |
#edit ⇒ Object
31 32 33 34 35 |
# File 'app/controllers/wf/places_controller.rb', line 31 def edit @workflow = Wf::Workflow.find(params[:workflow_id]) @place = @workflow.places.find(params[:id]) @workflow.name, workflow_path(@workflow) end |
#new ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/wf/places_controller.rb', line 8 def new @workflow = Wf::Workflow.find(params[:workflow_id]) @place = @workflow.places.new @workflow.name, workflow_path(@workflow) end |
#update ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/wf/places_controller.rb', line 37 def update @workflow = Wf::Workflow.find(params[:workflow_id]) @place = @workflow.places.find(params[:id]) if @place.update(place_params) redirect_to workflow_path(@workflow), notice: "place was successfully created." else render :edit end end |