diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb index beccce4..717cb40 100644 --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -43,7 +43,10 @@ class TasksController < ApplicationController end end - def delete; end + def delete + @task.destroy! + redirect_to tasks_path(project: @task.project) + end private diff --git a/app/views/projects/show.html.slim b/app/views/projects/show.html.slim index a878dad..05712cb 100644 --- a/app/views/projects/show.html.slim +++ b/app/views/projects/show.html.slim @@ -5,3 +5,4 @@ section= @project.description section ul.links li= link_to 'Edit', edit_project_path(@project) + li= link_to 'Tasks', tasks_path(project: @project) diff --git a/app/views/tasks/index.html.slim b/app/views/tasks/index.html.slim index 307ceed..83c1959 100644 --- a/app/views/tasks/index.html.slim +++ b/app/views/tasks/index.html.slim @@ -10,5 +10,7 @@ tr td= link_to task.full_number, task_path(task) td= task.title + td + = link_to 'Edit', edit_task_path(task) - else p No tasks diff --git a/app/views/tasks/show.html.slim b/app/views/tasks/show.html.slim index 672dcf5..b5ead18 100644 --- a/app/views/tasks/show.html.slim +++ b/app/views/tasks/show.html.slim @@ -3,3 +3,7 @@ div h1= @task.title section= @task.description + +section + ul.links + li= link_to 'Edit', edit_task_path(@task)