I have a database of people that have used a local foodbank. The problem I''m having now is that i need a way to put 2 collections into one variable, like rails does it for partials. I want a variable @oxford that does a Household.find_all_by_zip(''01540''). This is no problem. The trouble comes when I try to combine lists of new families and returning families to feed the partials properly.. What I have is a main page monthly.erb oxford families render partial => ''monthly_report'', :collection => @oxford _monthly_report.erb new families render partial => ''monthly_graph, :collection => monthly_report.new returning families render partial => ''monthly_graph, :collection => monthly_report.returning Rails doesn''t seem to like these two areas in the monthly_report variable without being setup, so I hope there is a way to do this. I''m hoping there is a way to set your collections the way you want to do a report. Please help me with the proper way to set this variable up Bob <bsm2th-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Sep-04 09:35 UTC
Re: Trying to create a collection to use for a report
On Sep 4, 9:18 am, Bob Smith <bsm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a database of people that have used a local foodbank. The > problem I''m having now is that i need a way to put 2 collections into > one variable, like rails does it for partials. I want a variable > @oxford that does a Household.find_all_by_zip(''01540''). This is no > problem. > > The trouble comes when I try to combine lists of new families and > returning families to feed the partials properly.. What I have is a > main page > > monthly.erb > oxford families > render partial => ''monthly_report'', :collection => @oxford > > _monthly_report.erb > new families > render partial => ''monthly_graph, :collection => monthly_report.new > > returning families > render partial => ''monthly_graph, :collection => > monthly_report.returning > > Rails doesn''t seem to like these two areas in the monthly_report > variable without being setup, so I hope there is a way to do this. I''m > hoping there is a way to set your collections the way you want to do a > report. Please help me with the proper way to set this variable up >What do you mean by "doesn''t seem to like"? What do the new & returning methods return ? Fred> Bob <bsm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.