Default task broadcast

This commit is contained in:
2025-11-03 00:38:57 +02:00
parent 1c644c6385
commit 7839a58464
3 changed files with 18 additions and 16 deletions
+2
View File
@@ -10,6 +10,8 @@ class Task < ApplicationRecord
has_rich_text :description has_rich_text :description
broadcasts_to ->(task) { [task.project, :tasks] }, template: 'tasks/_table_row'
def to_param def to_param
return full_number if association(:project).loaded? return full_number if association(:project).loaded?
+8
View File
@@ -0,0 +1,8 @@
- cache task do
tr id="task_#{task.id}"
td= link_to task.full_number, task_path(task)
td
= task_status_selector task, selector_class: 'small', id: "task_status_selector_#{task.id}", with_form: true
td= task.title
td
= link_to 'Edit', edit_task_path(task)
+8 -16
View File
@@ -1,20 +1,12 @@
h1= tasks_index_title h1= tasks_index_title
.row section.row
= link_to 'New', new_task_path(project: current_project&.code) = link_to 'New', new_task_path(project: current_project&.code)
- if @tasks.exists? table.tasks-table
table.tasks-table thead
thead tbody#tasks
tbody = render partial: 'table_row', collection: @tasks, as: :task
- @tasks.each do |task|
- cache task do - if current_project
tr = turbo_stream_from current_project, :tasks
td= link_to task.full_number, task_path(task)
td
= task_status_selector task, with_form: true
td= task.title
td
= link_to 'Edit', edit_task_path(task)
- else
p No tasks