On Wed, 2009-07-29 at 21:55 +0100, Colin Law wrote:
> 2009/7/29 Craig White <[email protected]>:
> >
> > I am getting a blank page, no errors, just a blank page.
> >
> > I have 2 files...
> > reports/city_taxes_print.erb
> > reports/_city_taxes_print.erb
> 
> Would not those normally be .html.erb?
----
probably...I tend to grasp at straws in desperation. They started out as
html.erb files
----
> >
> > and my method is city_taxes_print and after getting variables from the
> > controller, my erb file which is fairly basic...
> >
> > <% # City of Scottsdale
> >   @taxauthids = [ "32", "40" ]
> >   @report_title = "Scottsdale Sales Tax Detail Report for the Period
> > Ending " + @period.lastdate_in_period.strftime("%m-%d-%Y")
> >   @taxes = Debtortranstaxes.find(:all, :conditions => ["trandate
> > BETWEEN :begin AND :end AND taxauthid IN (:ids)", {:begin => @per1, :end
> > => @per2, :ids => @taxauthids}],
> >     :joins => 'LEFT JOIN debtortrans ON debtortrans.id=debtortransid',
> >     :include => 'debtortrans',
> >     :select => 'debtorno, trandate, transno, ovamount, taxamount,
> > taxauthid',
> >     :order => 'trandate, transno')
> >  render :partial => 'reports/city_taxes_print.erb'
> > %>
> >
> 
> I think render :partial has to be inside <%= %> not <% %>
> 
> Possibly not relevant to your problem but it is not usual to put code
> like the above in the view.  It would generally go in the
> controller/model, with as much of the code as possible in the models.
----
yes, the = inside the <% was of course relevant and the solution...duh,
thanks

as for why I would put logic inside view file...this stems from things
that I did successfully in 1.2.x that seemingly also do not work in
2.3.2 - perhaps I was taking advantage of undocumented 'features', aka
bugs.

The concept is to have one 'method' print several different pages with
different criteria for each 'partial' and using css div's to
'page-break-after' each one so that the result was multi-paged html.
This actually worked for me in 1.2.x but I am only getting the last page
in 2.3.2.  ;-(  The controller only allows a single 'render' command per
method.

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to