Tasks display

This commit is contained in:
2025-07-12 17:50:56 +03:00
parent 42d45853ff
commit 4f5b9dcf89
12 changed files with 120 additions and 7 deletions
+24
View File
@@ -0,0 +1,24 @@
# frozen_string_literal: true
class TasksController < ApplicationController
before_action :fetch_task, only: %w[show edit update delete]
def index
if params[:project]
@project = Project.find_by!(code: params[:project])
@tasks = @project.tasks
else
@tasks = Task.all
end
@tasks = @tasks.includes(:project)
end
def show; end
private
def fetch_task
@task = Task.find_by_full_number_or_id!(params[:id])
end
end