Class: ThinkFeelDoEngine::Manage::TasksController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ThinkFeelDoEngine::Manage::TasksController
- Defined in:
- app/controllers/think_feel_do_engine/manage/tasks_controller.rb
Overview
User manages task creation, destruction, and assignment for groups
Constant Summary
Constants inherited from ApplicationController
ApplicationController::CSRF_COOKIE_NAME, ApplicationController::CSRF_HEADER_NAME, ApplicationController::INACTIVE_MESSAGE, ApplicationController::ROOT_URI
Instance Method Summary collapse
Methods inherited from ApplicationController
#access_denied_resource_path, #after_sign_in_path_for, #after_sign_out_path_for
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/think_feel_do_engine/manage/tasks_controller.rb', line 16 def create @task = current_user.tasks.build(task_params) :create, @task if @task.save redirect_to arm_manage_tasks_group_path(@group.arm, @group), notice: "Task assigned." else errors = @task.errors..join(", ") flash[:alert] = "Unable to assign task: #{ errors }" redirect_to arm_manage_tasks_group_path(@group.arm, @group) end end |
#destroy ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/think_feel_do_engine/manage/tasks_controller.rb', line 29 def destroy :destroy, @task group = @task.group if @task.destroy flash.now[:success] = "Task unassigned from group." redirect_to arm_manage_tasks_group_path(group.arm, group) else errors = @task.errors..join(", ") flash[:error] = "Unable to delete task from group: #{ errors }" redirect_to arm_manage_tasks_group_path(group.arm, group) end end |
#index ⇒ Object
11 12 13 14 |
# File 'app/controllers/think_feel_do_engine/manage/tasks_controller.rb', line 11 def index :update, @group @learning_tasks = @group.learning_tasks end |