Hi all, I sent a message earlier, so forgive me if you have already
read this (I got some cryptic message in German about how my
e-mail was not read?). Anyway, I was just wondering if there was
any way to format the html that is output using
<%= @content_for_layout %>
I want to use something like the PHP Beautify. I guess I could
write my own, but I was hoping that Rails already had something
built in. Thanks to all. Have a great day.
The “content_for_layout” declaration simply renders a template within
the
layout… so… you’d probably want to just format the template in the
first
place ?
Otherwise, assuming the @content_for_layout variable actually contains
all
the HTML (which I haven’t bothered to look at), you could run this
variable
through a method of your choice prior to rendering.
Yes, I was hoping that Rails already had a method to make the html
pretty
without me having to write one. Or a library, or something. If not, all
I really
want is tabs and I wrote it in PHP, so I guess I could just copy the
algorithm.
Thanks for the repsonse =)
Not sure what you would need to do to hook it into a rails app.
You could also rewrite your rhtml files as rxml… at least I would
think that building
the page as an xml tree and then writing it out would create a nice neat
source output.