Topic: clean up html output with a filter?
A typical view in my app is rendered with several partials, a layout, helpers, etc etc. All of this code is written to be maintainable from the source code perspective. So for example a partial will start its first tag at the first level, it's first nested tag with one indent, etc etc.
This ultimately leads to html that is sent to the browser that is very messy. Generally I don't care about this output being messy, especially since the source itself is very clean. But I am now wanting to make my entire site's layout be done with CSS, and I want to inspect my outputted HTML to ensure no little style attributes, bgcolor attributes, bold, br, etc are sneaking in.
I'm hoping to find or write a filter that will take the entire output and format it nicely just before sending to the client. But it appears after_filter happens after the view has already been rendered. I have noticed rails also has around_filter, but haven't found much on what it really does.
Surely this can't be an uncommon desire. Anyone done this?
Last edited by tortoise (2007-01-27 14:33:41)