I have two classes Type and Entities. An entity has a type. If I want to count how many entities have the same type I would do
or(<%= Entity.count(:conditions =>{:Type_id => type.id})%>)
(<%= Entity.count(:conditions =>{:Type_id => type.1})%>)
Which would return something like
Number of entities (26)
No comments:
Post a Comment