开发者

Rails plugin to clean up (reformat) html output?

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜