Class: TasksController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#backend, #redis_not_available

Instance Method Details

#createObject



18
19
20
21
# File 'lib/engine/app/controllers/tasks_controller.rb', line 18

def create
  @task = Task.create(task_params)
  redirect_to action: :index
end

#destroyObject



29
30
31
32
33
# File 'lib/engine/app/controllers/tasks_controller.rb', line 29

def destroy
  @task = Task.find(params[:id])
  @task.destroy
  redirect_to action: :index
end

#editObject



14
15
16
# File 'lib/engine/app/controllers/tasks_controller.rb', line 14

def edit
  @task = Task.find(params[:id])
end

#indexObject



6
7
8
# File 'lib/engine/app/controllers/tasks_controller.rb', line 6

def index
  @tasks = Task.all
end

#newObject



10
11
12
# File 'lib/engine/app/controllers/tasks_controller.rb', line 10

def new
  @task = Task.new
end

#updateObject



23
24
25
26
27
# File 'lib/engine/app/controllers/tasks_controller.rb', line 23

def update
  @task = Task.find(params[:id])
  @task.update_attributes(task_params)
  redirect_to action: :index
end