I have managed to join 2 of my tables clients
and risk_codes
to each other where clients.risk_code_id
is a foreign key for risk_codes.id
.
In my edit view for Clients I ouput a form using the HTML Helper. E.g. to add an input to edit clients.name
I would use echo $this->Form->input('name');
Given that risk_codes
is a separate table/model how would I output a select dropdown with the options being risk_codes.name
and the values being risk_codes.id
?
The tables are linked like so:
Client belongsTo RiskCode
RiskCode hasMany Client