initial commit
This commit is contained in:
42
app/views/subprojects/_form.html.erb
Normal file
42
app/views/subprojects/_form.html.erb
Normal file
@@ -0,0 +1,42 @@
|
||||
<%= form_with(model: subproject) do |form| %>
|
||||
<% if subproject.errors.any? %>
|
||||
<div style="color: red">
|
||||
<h2><%= pluralize(subproject.errors.count, "error") %> prohibited this subproject from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% subproject.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.label :subproject_name, style: "display: block" %>
|
||||
<%= form.text_field :subproject_name %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :project_id, style: "display: block" %>
|
||||
<%= form.text_field :project_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :client_id, style: "display: block" %>
|
||||
<%= form.text_field :client_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :owner_id, style: "display: block" %>
|
||||
<%= form.text_field :owner_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :builder_id, style: "display: block" %>
|
||||
<%= form.text_field :builder_id %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
27
app/views/subprojects/_subproject.html.erb
Normal file
27
app/views/subprojects/_subproject.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<div id="<%= dom_id subproject %>">
|
||||
<p>
|
||||
<strong>Subproject name:</strong>
|
||||
<%= subproject.subproject_name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Project:</strong>
|
||||
<%= subproject.project_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Client:</strong>
|
||||
<%= subproject.client_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Owner:</strong>
|
||||
<%= subproject.owner_id %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Builder:</strong>
|
||||
<%= subproject.builder_id %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/subprojects/_subproject.json.jbuilder
Normal file
2
app/views/subprojects/_subproject.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! subproject, :id, :subproject_name, :project_id, :client_id, :owner_id, :builder_id, :created_at, :updated_at
|
||||
json.url subproject_url(subproject, format: :json)
|
||||
12
app/views/subprojects/edit.html.erb
Normal file
12
app/views/subprojects/edit.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<% content_for :title, "Editing subproject" %>
|
||||
|
||||
<h1>Editing subproject</h1>
|
||||
|
||||
<%= render "form", subproject: @subproject %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Show this subproject", @subproject %> |
|
||||
<%= link_to "Back to subprojects", subprojects_path %>
|
||||
</div>
|
||||
16
app/views/subprojects/index.html.erb
Normal file
16
app/views/subprojects/index.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<% content_for :title, "Subprojects" %>
|
||||
|
||||
<h1>Subprojects</h1>
|
||||
|
||||
<div id="subprojects">
|
||||
<% @subprojects.each do |subproject| %>
|
||||
<%= render subproject %>
|
||||
<p>
|
||||
<%= link_to "Show this subproject", subproject %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to "New subproject", new_subproject_path %>
|
||||
1
app/views/subprojects/index.json.jbuilder
Normal file
1
app/views/subprojects/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @subprojects, partial: "subprojects/subproject", as: :subproject
|
||||
11
app/views/subprojects/new.html.erb
Normal file
11
app/views/subprojects/new.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<% content_for :title, "New subproject" %>
|
||||
|
||||
<h1>New subproject</h1>
|
||||
|
||||
<%= render "form", subproject: @subproject %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Back to subprojects", subprojects_path %>
|
||||
</div>
|
||||
10
app/views/subprojects/show.html.erb
Normal file
10
app/views/subprojects/show.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<%= render @subproject %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Edit this subproject", edit_subproject_path(@subproject) %> |
|
||||
<%= link_to "Back to subprojects", subprojects_path %>
|
||||
|
||||
<%= button_to "Destroy this subproject", @subproject, method: :delete %>
|
||||
</div>
|
||||
1
app/views/subprojects/show.json.jbuilder
Normal file
1
app/views/subprojects/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "subprojects/subproject", subproject: @subproject
|
||||
Reference in New Issue
Block a user