blob: 98b12f4dc145ab71e28761c50d3be5a28e101339 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
class TaskListsController < ApplicationController
before_action :set_task_list, only: [:show, :edit, :update]
def index
@task_lists = TaskList.all
end
def show
end
def new
@task_list = TaskList.new
end
def edit
end
def update
@task_list.update!(params[:task_list])
end
def create
task_list = TaskList.create!(task_list_params)
redirect_to task_list_path(task_list)
end
private
def task_list_params
params.require(:task_list).permit(:name)
end
def set_task_list
@task_list = TaskList.find(params[:id])
end
end
|