Class: Wf::WorkflowsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Wf::WorkflowsController
- Defined in:
- app/controllers/wf/workflows_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/wf/workflows_controller.rb', line 43 def create @workflow = Wf::Workflow.new(workflow_params) if @workflow.save redirect_to workflows_path, notice: "workflow was successfully created." else render :new end end |
#destroy ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/controllers/wf/workflows_controller.rb', line 25 def destroy @workflow = Wf::Workflow.find(params[:id]) @workflow.destroy respond_to do |format| format.html { redirect_to workflows_path, notice: "workflow was successfully deleted." } format.js { render js: "window.location.reload();" } end end |
#edit ⇒ Object
16 17 18 19 |
# File 'app/controllers/wf/workflows_controller.rb', line 16 def edit @workflow = Wf::Workflow.find(params[:id]) @workflow.name, workflow_path(@workflow) end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/wf/workflows_controller.rb', line 8 def index @workflows = Wf::Workflow.order("id DESC").page(params[:page]) end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/wf/workflows_controller.rb', line 12 def new @workflow = Wf::Workflow.new end |
#show ⇒ Object
21 22 23 |
# File 'app/controllers/wf/workflows_controller.rb', line 21 def show @workflow = Wf::Workflow.find(params[:id]) end |
#update ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/controllers/wf/workflows_controller.rb', line 34 def update @workflow = Wf::Workflow.find(params[:id]) if @workflow.update(workflow_params) redirect_to workflow_path(@workflow), notice: "workflow was successfully updated." else render :edit end end |