Thursday, February 26, 2009

Re: Model Q: HABTM association the right way to go?

On Feb 26, 10:36 pm, TGurske <t...@gurske.com> wrote:
> That's how I initially set up the tables but when I baked it the bake
> defaults reversed everything - so all my edit views would give me a
> drop down list of location id's. It used belongsTo in the main tables
> and then hasOne and hasMany in the location table.
>
> So what should I use in the model?

Isn't that correct? Since you have a located_id field for the model,
the model's edit view will have a form containing an input element for
selecting the location_id to set/associate for/with that record you
are editing.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: