Class: Ltm::TasksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ltm/tasks_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
# File 'app/controllers/ltm/tasks_controller.rb', line 11

def create
  @task = Task.create(task_params)
  if @task.save
    redirect_to tasks_path, notice: "Task created"
  else
    render :new
  end
end

#indexObject



3
4
5
# File 'app/controllers/ltm/tasks_controller.rb', line 3

def index
  @tasks = Task.all
end

#newObject



6
7
8
9
10
# File 'app/controllers/ltm/tasks_controller.rb', line 6

def new
  @task = Task.new
  @users = User.all
  @tags = Tag.all
end