Trying to do a user list and getting double render errors

Here is where I am now. A render :partial at the **** would solve my
problem, but another render doesn’t seem to be allowed. Render_pdf
uses the only one allowed. Is there another way to do this?
At the moment, it works fine, but only gives me 1 user, even though it
makes the collections for each user.

                         Controller

def print
@households = Household.find(:all, :order => “last_name,
first_name”)
@households.each { |@household|
@today = Date.today
@year = @today.year
@churches = Church.find(:all, :order => “name”).map {|u|
[u.name, u.id]}
@thisyear =
Visit.find_all_by_year_and_household_id(Date.today.year,
@household.id)
@lastyear =
Visit.find_all_by_year_and_household_id(Date.today.year-1,
@household.id)
@yearbefore =
Visit.find_all_by_year_and_household_id(Date.today.year-2,
@household.id)


}
date=date +%Y%m%d-%H:%M
respond_to do |format|
format.pdf { send_data render_to_pdf( :action => ‘print’,
:layout => ‘pdf_report’),
:filename =>
“Household_List_for_” + date }
end
end

                   First view

<% javascript_include_tag :defaults %>

debugger
<% get_totals(@household) %>

Food Shelf

<% form_for @household, :url => household_path(@household), :html => { :method => 'put' } do |household| %>
<%= @child %> debugger
Family Size <%= @family%> 0-4 Years <%= @under5 %> 5-17 Years 18-64 Years <%= @adult %> 65 & Over <%= @senior %>
<%= render :partial => 'household', :object => @household %> <%= render :partial => 'people', :object => @household %>

Visits to Foodshelf

<% end %>

Month of <%= Date.today.year %> <%= render :partial => 'visit', :object => @thisyear %>
Monthly Bread & Veg only for Week
1 2 3 4 5
Month of <%= Date.today.year-1 %> <%= render :partial => 'visit', :object => @lastyear %>
Monthly Bread & Veg only for Week
1 2 3 4 5
Month of <%= Date.today.year-2 %> <%= render :partial => 'visit', :object => @yearbefore %>
Monthly Bread & Veg only for Week
1 2 3 4 5

Finally found a way around this. Only 1 render is allowed at the
controller level, but a view can have as many as wanted, so…
Leave the only allowed render in the controller for render_pdf, and do
a find(:all) in the controller. In the view with the same name as the
controller action, do a <%= render :partial => ‘whatever’, :object =>
@variable_from_controller %>

next make a partial view called _whatever.html.erb or _whatever.erb
for pdf output. The variable holding one record from the list will be
called whatever, with no @ before it. This partial is where whatever
output is wanted per record should be done.

Bob [email protected]