Class: Todoro::TaskListsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Todoro::TaskListsController
- Defined in:
- app/controllers/todoro/task_lists_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 16 def create @task_list = @taskable.task_lists.new(task_list_params) if @task_list.save redirect_to task_lists_path(taskable: @taskable), notice: "Task list created successfully." else render :new end end |
#destroy ⇒ Object
35 36 37 38 39 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 35 def destroy taskable = @task_list.taskable @task_list.destroy redirect_to task_lists_path(taskable: taskable), notice: "Task list deleted." end |
#edit ⇒ Object
25 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 25 def edit; end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 6 def index @task_lists = @taskable.task_lists end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 12 def new @task_list = @taskable.task_lists.new end |
#show ⇒ Object
10 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 10 def show; end |
#update ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/todoro/task_lists_controller.rb', line 27 def update if @task_list.update(task_list_params) redirect_to task_lists_path(taskable: @task_list.taskable), notice: "Task list updated successfully." else render :edit end end |