allow to view project related information like subproject and clients

This commit is contained in:
Stefan Tollkühn
2025-07-21 15:20:12 +02:00
parent 2c5741bb45
commit 828dc4a4a3
2 changed files with 14 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ class ProjectsController < ApplicationController
# GET /projects or /projects.json
def index
@projects = Project.all
@projects = Project.includes(:subprojects => [:client, :owner, :builder]).all
end
# GET /projects/1 or /projects/1.json
@@ -13,7 +13,7 @@ class ProjectsController < ApplicationController
# GET /projects/new
def new
@project = Project.new
@project.subprojects.build # initialize one subproject
@project.subprojects.build
@project.subprojects.each do |subproject|
subproject.build_client
subproject.build_owner