Hello,
I have a hash that contains categories, and each category ID is a
hash of subcategories. What i want to do is dynamically load that
hash, loop thru it, for each category , subcat run a query against the
DB, and render a partial. The issue is i put the render:partial in a
for loop but you can only render once per action. What is the best
way to loop thru all my categories without a multiple render?
I am trying to avoid things like
@cat1 = Post.find(:conditions => “cat = 1”) … especially since my
categories are dynamic.
and would like to do something like
categoryhash.each { |c|
@entries = Post.find(:all, :conditions => ["catid = ?",c.])
render partial
}
Any ideas ?
thanks
adam