# Minify html views layouts

**URL:** <https://www.ruby-forum.com/t/minify-html-views-layouts/186710>\
**Category:** Rails\
**Created:** [April 12, 2010, 2:41am UTC](https://www.ruby-forum.com/t/minify-html-views-layouts/186710 "2010-04-12T02:41:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/bb73d2/32.png) [@xia](https://www.ruby-forum.com/u/xia)\
**Post date:** [April 12, 2010, 2:41am UTC](https://www.ruby-forum.com/t/minify-html-views-layouts/186710/1 "2010-04-12T02:41:10Z")

</div>

Hello,

Does anyone have any tips for minifying views and layouts?

IE removing whitespace

Thanks ahead

---

<div class="post-metadata">

**Author:** ![xia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/bb73d2/32.png) [@xia](https://www.ruby-forum.com/u/xia)\
**Post date:** [April 12, 2010, 9:32pm UTC](https://www.ruby-forum.com/t/minify-html-views-layouts/186710/2 "2010-04-12T21:32:30Z")

</div>

I guess you’re talking about reducing the code produced by your rails  
app.

Are you using the -%\> notation such as :  
\<% if condition … -%\>  
The dash before the closing tag is a shortcut that make sure no new  
line will be added at this point.

This is the only trick I can think about.

Christophe
