Hey Guys,

Great help... I just started with CakePHP and I'm tuning in to the
Google Group to pick up some things.  I learned a lot through this
thread.  Thanks for that.

Best,
Jonathan

On Oct 10, 2:25 pm, Raphi <[email protected]> wrote:
> Ahh thank you guys so much!
>
> Adding the "url" to the form-helper did the trick. I'm using the Auth-
> component so I'll use $this->Auth->user('id') to identify the user.
> I also deleted the "belongsTo" statement from my user_profile model
> and everything is working in the exact same way so this really isn't
> necessary. It wasn't causing any problems but it's still good to know
> that you don't need it for a hasOne relation, so thanks for the info!
>
> thanks again and kind regards
>
> Raphi
>
> On 10 Okt., 08:38, and <[email protected]> wrote:
>
> > Sometimes, if you use both 'hasOne' and 'belongsTo' it doesn't work. I
> > experienced it very often. Try just to use one of them.
> > And the second point is that, if you have typed it here correctly,
> > your $belongsTo is not correct. $belongsTo = array('....'); but try it
> > without belongsTo. I had those issues also in my usermanagement where
> > I wanted to create a connection from the user itself to some special
> > properties like birthday and stuff like that.
>
> > keep going :-)
>
> > On 3 Okt., 20:01,Raphi<[email protected]> wrote:
>
> > > Hi there,
>
> > > I'm new to Cake and now I seem to have a little understanding problem.
> > > The situation is this:
>
> > > I have a UsersController and a User Model. Then there is an
> > > editProfile() method within my UsersController. Of course I also
> > > created a view (users/edit_profile.ctp). My problem is that I want to
> > > have an editable automagic form on that page that is linked to the
> > > user_profiles table.
>
> > > What I did is, I added "var $hasOne = array('UserProfile');" to my
> > > User Model. And I created a form like this:
>
> > >     echo $form->create('UserProfile');
> > >     echo $form->input('id');
> > >     echo $form->input('name');
> > >     echo $form->end();
>
> > > Then I created a user_profile.php model file and added "var $belongsTo
> > > = 'User';" to it. The user_profiles table has a "user_id" foreign key.
>
> > > When I send the form, cake throws an error as it cannot find the
> > > "UserProfileController". Normally this would be ok but for I want the
> > > UsersController to do all the work it's not. What can I do? I mean, I
> > > could create a user_profiles_controller.php to send the form and
> > > afterwards do a redirect to the form but that wouldn't be very
> > > fashionable.
>
> > > I hope you can help me out.
>
> > > Regards
>
> > >Raphi

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to