Tell me how to show the value of a field from another table (has many) when outputting?
There are two tables: patients and analyzes. I display the data for patients, but in this output, the value of the two fields should be inferred from the analysis table. How to do it?
Thank you in advance!(has many)
This is done in the controller, and what needs to be written in the “Template”?
You should use the association properties. Something like
I have two tables “analyzes” (id, number, date, result and patient_id) and “patients” (last name, first name, birthday, gender).
My task: in the patient template, derive: for each patient, derive values from the analyzes (date and result).
How to do it? What needs to be done in the controller and in the patient template?