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| %>
|