Tom:
the final -%> differs from %> in that if there is no text produced
between the delimiters then it takes no space on the page. I believe
the standard delimiter %> would take up some space whether or not it
needed to. A good example of when this may be useful (I used it the
other day) is if you were making invoices and had something like
<% org.company_name %> #no need for fancy delimiter as all
companies will have names
<% org.address1 %> #as above
<% org.address2 -%> #note fancy delimiter because many
companies don''t have an address2 and we don''t want a blank
line
appearing in the address.
bruce
On 7-Nov-05, at 5:06 PM, Tom Dell''Aringa wrote:
> I have a question about ruby code delimiters.
>
> This code block:
>
> <% end -%>
>
> What does the "-" before the ending delimiter signify? My code
> errored out, I thought those were
> misprints or something in the book, but added them and it works. I
> don''t recall seeing that in the
> Ruby appendix, and I''ve never seen this convention before (like
> with JSP or ASP).
>
> TIA
>
> Tom
>
>
> http://www.pixelmech.com/
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails