<%= address.gsub(/\n/, ''<br />'') %>
-Nb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nathaniel S. H. Brown http://nshb.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -----Original Message-----
> From: rails-bounces@lists.rubyonrails.org
> [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of charley ramm
> Sent: March 6, 2006 3:49 PM
> To: rails@lists.rubyonrails.org
> Subject: [Rails] Convert \n newlines to html <br>
>
> I have a textarea that accepts a shipping address, so I need
> to convert newlines when it is displayed as html. I am new to
> ruby, and rails so an example would be appreciated. I want to
> do this in the ''display'', not the stored text if
possible,
> since I use the newlines when generating a pdf.
> Thanks.
> charley
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>