Added CRUD links for projects/tasks and validation display

This commit is contained in:
KaungKaung
2026-01-27 16:57:50 +06:30
parent fbb09e4015
commit 910c1912e0
3 changed files with 19 additions and 2 deletions

View File

@@ -2,6 +2,11 @@
<ul>
<% @projects.each do |project| %>
<li><h3><%= project.project_name %></h3></li>
<li><h3><a href="<%= project_path(project) %>"><%= project.project_name %></a></h3></li>
<%= link_to "Destroy", project_path(project), data: {
turbo_method: :delete,
turbo_confirm: "Are you sure?"
} %>
<% end %>
</ul>

View File

@@ -4,11 +4,17 @@
<div>
<%= form.label :project_name %><br>
<%= form.text_field :project_name %>
<% @project.errors.full_messages_for(:project_name).each do |message| %>
<p><%= message %></p>
<% end %>
</div>
<div>
<%= form.label :description %><br>
<%= form.text_area :description %>
<% @project.errors.full_messages_for(:description).each do |message| %>
<p><%= message %></p>
<% end %>
</div>
<div>

View File

@@ -6,5 +6,11 @@
<li>
<%= task.title %> (<%= task.status %>)
</li>
<%= link_to "Destroy", project_task_path(@project, task), data: {
turbo_method: :delete,
turbo_confirm: "Are you sure?"
} %>
<% end %>
</ul>
<%= link_to "Add Task", new_project_task_path(@project) %>