From: Jamis Buck Date: 2005-07-21T07:49:26+09:00 Subject: Re: Alternative to <%= On Jul 20, 2005, at 4:40 PM, Brian Takita wrote: > But now that I think about it, something like this would work out > better: > > <%= > begin > out = ' out << ' style="text-align: center"' if @has_style > out << '...' if @show_another_attribute > out << '>' > out << Paragraph > out << '

> end > %> This looks like a prime candidate for refactoring into a helper, actually: >Paragraph

With the corresponding helper definition: def my_custom_p_attrs attrs = "" attrs << %{ style="text-align: center"} if @has_style attrs << %{ ...} if @show_another_attribute attrs end - Jamis