From 910c1912e0eaa3f1cf1c21a45db2296cf3c308b2 Mon Sep 17 00:00:00 2001 From: KaungKaung Date: Tue, 27 Jan 2026 16:57:50 +0630 Subject: [PATCH] Added CRUD links for projects/tasks and validation display --- app/views/projects/index.html.erb | 7 ++++++- app/views/projects/new.html.erb | 6 ++++++ app/views/projects/show.html.erb | 8 +++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 127fe18..6c15d46 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -2,6 +2,11 @@ diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index e9feebd..62a2795 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -4,11 +4,17 @@
<%= form.label :project_name %>
<%= form.text_field :project_name %> + <% @project.errors.full_messages_for(:project_name).each do |message| %> +

<%= message %>

+ <% end %>
<%= form.label :description %>
<%= form.text_area :description %> + <% @project.errors.full_messages_for(:description).each do |message| %> +

<%= message %>

+ <% end %>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index fbb2f53..d44d6b8 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -6,5 +6,11 @@
  • <%= task.title %> (<%= task.status %>)
  • + <%= link_to "Destroy", project_task_path(@project, task), data: { + turbo_method: :delete, + turbo_confirm: "Are you sure?" + } %> <% end %> - \ No newline at end of file + + +<%= link_to "Add Task", new_project_task_path(@project) %> \ No newline at end of file