Friday, May 28, 2010

Re: HABTM Question.

I am *guessing* that your variable that contains your funny_tags is not being set correctly. It is set here:

$tags = $this->Post->Tag->find('list',array('fields'=>array('id','name')));

...so change that to:

$funny_tags = $this->Post->FunnyTag->find('list',array('fields'=>array('id','name')));

...and change this:
$this->set(compact('tags'));

...to this:
$this->set(compact('funny_tags'));

Does that resolve it?

Jeremy Burns
jeremyburns@me.com


On 29 May 2010, at 04:20, Roland Pish wrote:

> Hi!
> I've been struggling for a long time with something and I don't seem
> to get it.
> I did the Posts/Tags HABTM Select example from this page:
>
> http://mrphp.com.au/code/working-habtm-form-data-cakephp
>
> So far so good, everything works ok.
>
> I wanted to try the same example but asumming that the table tags is
> now called funny_tags (just to make a test with a more complex table
> names), so the model now is FunnyTag and the join table is
> funny_tags_posts and I did the all the changes needed according to
> cake naming conventions.
> The problem is that this example no longer populates the select list.
>
> Has anyone looked at this example before?
> How can this must be modified to work with table complex names as
> funny_tags_posts?
>
> I really appreciate you help.
>
> Regards.
>
> 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 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

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 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: