Nested routes, Listed tasks associated with projects
This commit is contained in:
7
app/views/projects/index.html.erb
Normal file
7
app/views/projects/index.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<h1>Projects</h1>
|
||||
|
||||
<ul>
|
||||
<% @projects.each do |project| %>
|
||||
<li><h3><%= project.project_name %></h3></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
17
app/views/projects/new.html.erb
Normal file
17
app/views/projects/new.html.erb
Normal 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 %>
|
||||
10
app/views/projects/show.html.erb
Normal file
10
app/views/projects/show.html.erb
Normal 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>
|
||||
Reference in New Issue
Block a user