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?
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.
As I posted earlier, I want to count lines in a text area.
I use the following function
lines = texto.split(/\n/).size if texto !=nil
But fails when one line of text “wraps” automatically to the next line
so no “\n” mark is returned into the text.
So i found the “wrap” attribute of textareas that works this way:
soft
hard
off
Soft forces the words to wrap once inside the text area but
when the form is submitted, the words will no longer appear as such
(Line breaks will not be added).
Hard wraps the words inside the text box and places line
breaks at the end of each line so that when the form is submitted it
appears exactly as it does in the text box.
Off sets a textarea to ignore all wrapping and places the
text into one ongoing line.
So I insert it in my txtarea definition like this:
" example line 1 \r\n line 2 without enter \n line 3 with enter"
So I conclude that the “wrapped” lines return with “\r\n” mark.
No problem but my original function splits by “\n” mark:
lines = texto.split(/\n/).size if texto !=nil
But Oooooppppssss the result is again 2. Split function only work with "\n" mark alone. Do not when then "\n" mark have a folk mark "\r" by it side ?
I am preparing to kill “\r” marks…(only inside the “texto” field…)