The basic thing here that i don''t understand is how to use
''find'' in
such a way that it only returns the votes for which the owner''s
profile gender for example equals ''m''. I think i have to use
:include,
but can''t really figure out the syntax to do so.
On Jan 30, 1:43 am, Peter
<peterdun...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''d like to display some kind of histogram from user-data, but i
don''t
> really know the approach to do so. I have a model Vote, they belong to
> a User (user has_many votes), and each User has a Profile, and in
> there i store things like age, location, etc. (user.profile.age or
> vote.user.profile.age)
>
> I now have a certain collection of votes from which i want a
> histogram, and what i would like to have is for example for the ages a
> result like: 0-20 => 15 votes, 21-50 => 10 votes, and 50+ => 2
votes
> (the collection would have 27 votes)
>
> how do i set this up?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---