Forum: Ruby on Rails Formating @content_for_layout

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Toph (Guest)
on 2006-02-15 03:28
(Received via mailing list)
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.

--
Topher Fangio
removed_email_address@domain.invalid
http://www.fangiotophia.com

Website Specialist
Fangiotophia Designs
(325) 660-7141
Dylan S. (Guest)
on 2006-02-15 03:49
(Received via mailing list)
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.
Toph (Guest)
on 2006-02-15 04:40
(Received via mailing list)
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 =)

On 2/14/06, Dylan S. <removed_email_address@domain.invalid> wrote:
> On 2/14/06, Toph <removed_email_address@domain.invalid> wrote:
> > built in. Thanks to all. Have a great day.
> > Rails mailing list
>
>


--
Topher Fangio
removed_email_address@domain.invalid
http://www.fangiotophia.com

Website Specialist
Fangiotophia Designs
(325) 660-7141
Ezra Z. (Guest)
on 2006-02-15 08:39
(Received via mailing list)
There is a ruby interface to the tidy library. Sop you can use that
to tidy up your html before output.

Cheers-
-Ezra

On Feb 14, 2006, at 6:37 PM, Toph wrote:

>> within the
>>
>>> I want to use something like the PHP Beautify. I guess I could
>>> (325) 660-7141
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>
> Website Specialist
> Fangiotophia Designs
> (325) 660-7141
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

-Ezra Z.
WebMaster
Yakima Herald-Republic Newspaper
removed_email_address@domain.invalid
509-577-7732
Ben M. (Guest)
on 2006-02-15 11:01
(Received via mailing list)
Toph wrote:
>
I sent this earlier, but it sounds like you didn't see any responses,
so:

There is a ruby interface to tidy:

http://rubyforge.org/projects/tidy/

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.

b
Leo -. (Guest)
on 2006-04-14 12:25
(Received via mailing list)
If someone is still interested on this topic:

http://www.cosinux.org/blogs/dam/pages/rails-tidy
This topic is locked and can not be replied to.