views:

212

answers:

2

Is there any plugin (gem) that after rendering page can clean and reformat it? By cleaning I mean removing unnecessary new lines and whitespaces.

A: 

Apologies if this is too orthogonal an answer: You should consider just making sure gzip compression is enabled. This makes it easier to view your src pages for debugging, requires less fiddling, and is a bigger win then simply removing unnecessary whitespace. If you have Apache as the front end, you could use mod_deflate (e.g., http://stackoverflow.com/questions/250566/how-do-i-gzip-webpage-output-with-rails) and other servers have similar gzip support. Most modern browsers support gzip, so you'll get the biggest bang for your buck.

Jason Yanowitz
A: 

Perhaps you are looking for http://www.railslodge.com/plugins/455-rails-tidy Jason's point about ensuring gzip is enables is super important as well.

Sam Saffron