Cakephp Associations Error? Won't Save Associated Table
Solution 1:
You are trying to Associated model's data. And your primary Model does not have data to save.
You can take two approaches here,
Your present way, take
User
's info and have them provideUserWeb
information from the same form. The use will provide the information as a part of registration. For this you should refer to Saving Associated model data - saveAll()Second way, have user provide their info during registration and let them add
UsersWeb
later. (by later I mean user's can update it during registration as well but not in same form). For this useUserWeb
. Have the same form appear from/yourapp/UsersWebs/add
. You will have to provide theuser_id
. This will be more refined.
P.S: I strongly recommend you to go through Saving your data again. It will hardly take you 10 mins, I am sure you have done this before but sparing another 10 mins after having encountered the issue will help you understand these things as back of your hand.
Post a Comment for "Cakephp Associations Error? Won't Save Associated Table"