Nested routes, Listed tasks associated with projects

This commit is contained in:
KaungKaung
2026-01-27 11:43:00 +06:30
parent fd0a6fb408
commit 6c3180f203
6 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
<h1>Projects</h1>
<ul>
<% @projects.each do |project| %>
<li><h3><%= project.project_name %></h3></li>
<% end %>
</ul>

View File

@@ -0,0 +1,17 @@
<h1>New Project</h1>
<%= form_with model: @project do |form| %>
<div>
<%= form.label :project_name %><br>
<%= form.text_field :project_name %>
</div>
<div>
<%= form.label :description %><br>
<%= form.text_area :description %>
</div>
<div>
<%= form.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,10 @@
<h1><%= @project.project_name %></h1>
<p><%= @project.description %></p>
<ul>
<% @project.tasks.each do |task| %>
<li>
<%= task.title %> (<%= task.status %>)
</li>
<% end %>
</ul>