I guess the DRY-way says that your should make some use of
http://www.ruby-doc.org/stdlib/libdoc/csv/rdoc/classes/CSV/Writer.html
from your template - just make one giant ERB block and call the Writer
from there.
On 7-apr-05, at 20:46, Raphael Bauduin wrote:
> Hi,
>
> I have a template generating an html list, and I thought to reuse the
> same template to generate the same list in CSV format. The problem is
> that for csv, a new line is significant, which is not the case in
> html. And a rhtml template creates a lot of newlines where I just
> would like a ",".
>
> So, what is the shortest path from a rhtml template to a csv list?
>
--
Julian "Julik" Tarkhanov