Class: PlanMyStuff::ProjectItems::StatusesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- PlanMyStuff::ProjectItems::StatusesController
- Defined in:
- app/controllers/plan_my_stuff/project_items/statuses_controller.rb
Overview
Handles moving a project item to a new status column via CRUD-style routes. Backs the status dropdown on the project board view (T-046).
PATCH /projects/:project_id/items/:item_id/status -> update (moves to new status)
Instance Method Summary collapse
-
#update ⇒ Object
PATCH /projects/:project_id/items/:item_id/status.
Instance Method Details
#update ⇒ Object
PATCH /projects/:project_id/items/:item_id/status
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/plan_my_stuff/project_items/statuses_controller.rb', line 12 def update item = find_project_item item.move_to!(params[:status]) flash[:success] = "Item moved to #{params[:status]}." redirect_to(plan_my_stuff.project_path(params[:project_id])) rescue ArgumentError, PMS::Error => e flash[:error] = e. redirect_to(plan_my_stuff.project_path(params[:project_id])) end |