in your TasksController
function index($id)
{
$this->Task->find('all', array('conditions'=>array('Task.company_id'=>
$id)));
}
i assume each task in your tasks table has a related company_id and
that the action you are pointing to is yoursite.com/tasks/index/id
On May 20, 2:18 pm, programguru <[email protected]> wrote:
> The simplicity of what I am trying to achieve is, first off, all of my other
> code is functioning properly as it stands.
>
> But for example,
>
> I have "Companies" and each "Company" has many "Tasks" associated with it.
>
> And on the index view results for my tasks, I need the company name to
> display as a link, that when clicked, will display ONLY the associated tasks
> of that company. I was able to achieve the link, but could not get the
> results as I need to generate.
>
> This works perfectly fine in standard scaffolding ($scaffold) but I have
> baked my scripts now, and am customizing the output manually.
>
> Does anyone have a suggestion or idea as to how I can achieve what I need
> to?
>
> --
> View this message in
> context:http://www.nabble.com/fetching-associated-records-from-url-tp23640799...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---