Class: Todoro::TaskListsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/todoro/task_lists_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#destroyObject



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

#editObject



25
# File 'app/controllers/todoro/task_lists_controller.rb', line 25

def edit; end

#indexObject



6
7
8
# File 'app/controllers/todoro/task_lists_controller.rb', line 6

def index
  @task_lists = @taskable.task_lists
end

#newObject



12
13
14
# File 'app/controllers/todoro/task_lists_controller.rb', line 12

def new
  @task_list = @taskable.task_lists.new
end

#showObject



10
# File 'app/controllers/todoro/task_lists_controller.rb', line 10

def show; end

#updateObject



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