add project attributes to project form

This commit is contained in:
Stefan Tollkühn
2025-07-21 16:31:23 +02:00
parent c04f2170e2
commit 92c34283b0
2 changed files with 6 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ class ProjectsController < ApplicationController
# Only allow a list of trusted parameters through.
def project_params
params.require(:project).permit(
:name,
:name, :email, :short_name,
subprojects_attributes: [
:id, :subproject_name, :client_id, :owner_id, :builder_id, :_destroy,
client_attributes: [:company_name, :firstname, :lastname, :streetname, :zipcode, :city, :country, :email, :phone],

View File

@@ -11,10 +11,12 @@
</div>
<% end %>
<% [:name, :email, :short_name, :offer_date, :order_date].each do |prj_attrib| %>
<div>
<%= form.label :name, style: "display: block" %>
<%= form.text_field :name %>
<%= form.label prj_attrib, style: "display: block" %>
<%= form.text_field prj_attrib %>
</div>
<% end %>
<h3>Subprojects</h3>
<%= form.fields_for :subprojects do |sp_form| %>