add project attributes to project form
This commit is contained in:
@@ -72,7 +72,7 @@ class ProjectsController < ApplicationController
|
|||||||
# Only allow a list of trusted parameters through.
|
# Only allow a list of trusted parameters through.
|
||||||
def project_params
|
def project_params
|
||||||
params.require(:project).permit(
|
params.require(:project).permit(
|
||||||
:name,
|
:name, :email, :short_name,
|
||||||
subprojects_attributes: [
|
subprojects_attributes: [
|
||||||
:id, :subproject_name, :client_id, :owner_id, :builder_id, :_destroy,
|
:id, :subproject_name, :client_id, :owner_id, :builder_id, :_destroy,
|
||||||
client_attributes: [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone],
|
client_attributes: [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone],
|
||||||
|
|||||||
@@ -11,10 +11,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% [:name, :email, :short_name, :offer_date, :order_date].each do |prj_attrib| %>
|
||||||
<div>
|
<div>
|
||||||
<%= form.label :name, style: "display: block" %>
|
<%= form.label prj_attrib, style: "display: block" %>
|
||||||
<%= form.text_field :name %>
|
<%= form.text_field prj_attrib %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<h3>Subprojects</h3>
|
<h3>Subprojects</h3>
|
||||||
<%= form.fields_for :subprojects do |sp_form| %>
|
<%= form.fields_for :subprojects do |sp_form| %>
|
||||||
@@ -30,7 +32,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Or Create New <%= role.capitalize %></legend>
|
<legend>Or Create New <%= role.capitalize %></legend>
|
||||||
<%= sp_form.fields_for role do |c_form| %>
|
<%= sp_form.fields_for role do |c_form| %>
|
||||||
<% [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone].each do |attrib|%>
|
<% [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone].each do |attrib| %>
|
||||||
<%= c_form.label attrib %>
|
<%= c_form.label attrib %>
|
||||||
<%= c_form.text_field attrib %><br>
|
<%= c_form.text_field attrib %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user