# Ruby equivalent to PHP Beautify?

**URL:** <https://www.ruby-forum.com/t/ruby-equivalent-to-php-beautify/53810>\
**Category:** Rails\
**Created:** [February 14, 2006, 8:06pm UTC](https://www.ruby-forum.com/t/ruby-equivalent-to-php-beautify/53810 "2006-02-14T20:06:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/848f3c/32.png) [@Toph](https://www.ruby-forum.com/u/Toph)\
**Post date:** [February 14, 2006, 8:06pm UTC](https://www.ruby-forum.com/t/ruby-equivalent-to-php-beautify/53810/1 "2006-02-14T20:06:58Z")

</div>

Hi all,

I am working on a project in Rails for my senior seminar  
class. I am fairly new to Rails but I have done a major  
project, so I know a little. The one thing I cannot find  
however is a way to make the html code that is output  
look any cleaner. So, I was wondering if there was a  
function/library/extension that worked like PHP  
beautify. Thanks for your input in this matter. I am sure  
I will be asking lots of questions as my project gets even  
deeper, so I apologize if you get to know me too well 😉  
Thanks again and have a great day!

Oh, and to anyone who cares, happy Valentine’s Day!

–  
Topher Fangio  
removed\_email\_address@domain.invalid  
[http://www.fangiotophia.com](http://www.fangiotophia.com)

Website Specialist  
Fangiotophia Designs  
(325) 660-7141

---

<div class="post-metadata">

**Author:** ![Toph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/848f3c/32.png) [@Toph](https://www.ruby-forum.com/u/Toph)\
**Post date:** [February 15, 2006, 5:02am UTC](https://www.ruby-forum.com/t/ruby-equivalent-to-php-beautify/53810/2 "2006-02-15T05:02:14Z")

</div>

There is a ruby interface to tidy:

[http://rubyforge.org/projects/tidy/](http://rubyforge.org/projects/tidy/)

Not sure whay 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

---

<div class="post-metadata">

**Author:** ![Toph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/848f3c/32.png) [@Toph](https://www.ruby-forum.com/u/Toph)\
**Post date:** [February 15, 2006, 5:02am UTC](https://www.ruby-forum.com/t/ruby-equivalent-to-php-beautify/53810/3 "2006-02-15T05:02:15Z")

</div>

There is a ruby interface to tidy:

[http://rubyforge.org/projects/tidy/](http://rubyforge.org/projects/tidy/)

Not sure why 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

---

<div class="post-metadata">

**Author:** ![Toph](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/848f3c/32.png) [@Toph](https://www.ruby-forum.com/u/Toph)\
**Post date:** [April 14, 2006, 10:25am UTC](https://www.ruby-forum.com/t/ruby-equivalent-to-php-beautify/53810/4 "2006-04-14T10:25:31Z")

</div>

If someone is still interested on this topic:

[http://www.cosinux.org/blogs/dam/pages/rails-tidy](http://www.cosinux.org/blogs/dam/pages/rails-tidy)
