Hmmm the scope may indeed solve the collection problem but how do I integrate it with a page that already has another collection?
On Mar 9, 3:56 pm, Bob Sleys <[email protected]> wrote: > Have you though about using a scope and sql to do all this for you? I do > something similar but not quite as complex but I would thing you could use > sql to aggregate the numbers you need. > > Here is where I find all materials that are loaded for a building. This is > in the materials model and I pass to it in controller where a need a > collection of all building materials the building I'm interested in ie > @building_materials = Material.for_building(@material.building) > > scope :for_building, lambda { |b| > where("building_id = ?", b.id). > order(:name) > } > > Bob > > > > > > > > On Friday, March 9, 2012 9:44:30 AM UTC-5, Scorpio wrote: > > > I'm almost done fighting with my logging model and i've got an IP > > details page where a collection if filtered as follows > > > def ip > > self.this = IpLog.where(:logged_ip => params[:ip]) > > end > > > I've created a custom collection that shows the dates actions and all > > the stuff I need just the way I need it but above that collection I'd > > like to have something like a subsection "Users that have logged in > > with this ip" (not spot on English but you get what I mean hopefully) > > > Idealy I'd like there to be 4 columns in that subsection > > > Name | Last Login| First Login | Number of times logged in > > > technically the base collection already has that info as it has every > > action from that ip so I just kinda need to filter this base > > collection and count it. I know how to do a rails count but filtering > > in a collection tag _ABOVE_the base collection while keeping the base > > intact is a problem. So is counting with Hobo (Man... that sounds like > > a kids book "Counting with Hobo" nvm- off-topic ). I'm concerned about > > filtering so that it keeps the good data below the secondary > > collection as it is. -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
