Friday, November 28, 2008

Re: belongsTo via form

Thank you for your reply.

I can't get it working. Neither the validation nor the adding of a
dataset is working.

On 26 Nov., 23:35, thatsgreat2345 <thatsgreat2...@gmail.com> wrote:
> instead of company do Company.name or whatever field you have called
> to save the name.
>
> On Nov 26, 2:18 pm, Sebastian Göttschkes
>
> <sebastian.goettsch...@boosolution.de> wrote:
> > Hi there,
>
> > I got a problem I cannot solve using the docs or google.
>
> > I have a Model User, which contains all users. Every User belongs to a
> > Company, so I added a foreign key company_id to the users table and
> > added a table companies. Everything is working well to this point.
>
> > Know I want to add the following workflow:
> > When a user is created, he can add the company he belongs to by just
> > entering the name of this company to a input-field (type: text). So I
> > added the following to the view:
> > <?= $form->input('company',array('type'=>'text')); ?>
> > But how do I proceed within the add action? Espacially when I want to
> > use the validation.
>
> > I'm not sure if I have to create a new company-object and validate
> > everything myself or if I can use some build-in functionallity.
>
> > Thanks in advance.
>
> > Regards,
> > Sebastian
--~--~---------~--~----~------------~-------~--~----~
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: