diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 908d09d..54609b0 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -2,19 +2,21 @@
<%= @project.description %>
<%= turbo_frame_tag "tasks" do %>
-
- <% # First: pending or in-progress tasks %>
- <%= render @project.tasks.reject { |t| t.status == "done" } %>
- <% done_tasks = @project.tasks.select { |t| t.status == "done" } %>
- <% if done_tasks.any? %>
- <%= render done_tasks %>
+
+ <% @project.tasks.where(status: %w[to_do in_progress]).each do |task| %>
+ <%= render partial: "tasks/task", locals: { task: task } %>
<% end %>
+
+
+ <% @project.tasks.where(status: "done").each do |task| %>
+ <%= render partial: "tasks/task", locals: { task: task } %>
+ <% end %>
+
+
<% end %>
<%= turbo_frame_tag "new_task" do %>
-
- Add New Task
<%= render "tasks/form", project: @project, task: Task.new %>
<% end %>
diff --git a/app/views/tasks/_form.html.erb b/app/views/tasks/_form.html.erb
index f3c7ef7..a6a22ea 100644
--- a/app/views/tasks/_form.html.erb
+++ b/app/views/tasks/_form.html.erb
@@ -1,3 +1,5 @@
+Add New Task
+
<%= form_with model: [project, task], local: false do |f| %>
<%= f.label :title %>
@@ -6,7 +8,7 @@
<%= f.label :status %>
- <%= f.select :status, Task.statuses.keys %>
+ <%= f.select :status, Task.statuses.keys.reject { |s| s == "done" } %>
<%= f.submit "Create Task" %>
diff --git a/app/views/tasks/_task.html.erb b/app/views/tasks/_task.html.erb
index 7edd2e7..efd7312 100644
--- a/app/views/tasks/_task.html.erb
+++ b/app/views/tasks/_task.html.erb
@@ -1,4 +1,3 @@
-
-
<%= task.title %>
<%= task.status.titleize %>
@@ -17,4 +16,3 @@
class: "task-btn destroy-btn" %>
-
\ No newline at end of file
diff --git a/app/views/tasks/complete.turbo_stream.erb b/app/views/tasks/complete.turbo_stream.erb
index 34efcab..7b6386f 100644
--- a/app/views/tasks/complete.turbo_stream.erb
+++ b/app/views/tasks/complete.turbo_stream.erb
@@ -1,3 +1,3 @@
<%= turbo_stream.replace dom_id(@task) do %>
- <%= render @task %>
+ <%= render partial: "tasks/task", locals: { task: @task } %>
<% end %>
diff --git a/app/views/tasks/create.turbo_stream.erb b/app/views/tasks/create.turbo_stream.erb
index 9ec72d4..67cfd7f 100644
--- a/app/views/tasks/create.turbo_stream.erb
+++ b/app/views/tasks/create.turbo_stream.erb
@@ -1,6 +1,6 @@
-<%= turbo_stream.append "tasks" do %>
- <%= render @task %>
-<% end %>
+<%= turbo_stream.prepend "active_tasks" do %>
+ <%= render partial: "tasks/task", locals: { task: @task } %>
+ <% end %>
<%= turbo_stream.replace "new_task" do %>
<%= render "tasks/form", project: @project, task: Task.new %>