On 20 July 2010 03:22, badnaam wrote:
> I have 3 models GrandPa, Pa, Kid
>
> GrandPa => has_many :pas
> Pa => has_many kids
>
> When I list GrandPa I would like to present the following
>
> *
> 1 - GrandPa_Name
>
> 2 - List of Pas sorted by the number ki
Kid has one pa and has one grandpa through pa
Pa has one to many kids and has one grandpa
Grandpa has one to many kids and has one pa
<%= :name[gp]
?pa = kid if from gp?
I think you should just have one model with a foreign key to parent and
quantity of child including nil.
On Mon, Jul 19, 201
I have 3 models GrandPa, Pa, Kid
GrandPa => has_many :pas
Pa => has_many kids
When I list GrandPa I would like to present the following
*
1 - GrandPa_Name
2 - List of Pas sorted by the number kids each pa has in descending
order
**
3 matches
Mail list logo