1

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

klew
  • 14,837
  • 7
  • 47
  • 59

2 Answers2

0

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., 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.

Community
  • 1
  • 1
Jason Yanowitz
  • 398
  • 2
  • 4
0

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
  • 128,308
  • 78
  • 326
  • 506