On Lunes, 1 de Junio de 2009 15:43:19 harv escribió:
> Hi,
>
> I have a Project model and a TaskType model.
> Association between the two occurs through a ProjectTaskType model
> (I.e. a link table in the DB with foreign keys to both Projects and
> TaskTypes).
>
> A Project has_many TaskTypes through ProjectTaskType, and a TaskTypes
> has_many Projects through ProjectTaskType.
>
> I have a vew with an embedded scaffold and want to display all
> TaskTypes belonging to a given Project.
>
> Can someone quide me as to how I would right the conditions for this?
>
> <%= render
>
>    :active_scaffold => :task_type,
>    :label => 'Task Types',
>    :conditions => "select TaskTypes which are associated with @project
>
> through the ProjectTaskType" %>
>
> And can my filtering logic go elsewhere?

They are the same conditions you have to use if you use TaskType.find
Something like ['project_task_types.project_id = ?', @project]

-- 
Sergio Cambra .:: entreCables S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to