UTF8 BOM, Rails Views & Phantom Space

Some how my XHTML was not formatting properly. Firefox, added phantom spacing around an element, which I was not able to recover with the CSS. I found rails was sending a weird character where it merges the template with the view yield. That turned out to be the UTF8 BOM which was added by my previous text editors to the view files. Textmate does not add this and it wont remove if the file already has one. The worse part is, rails renderer send this to the browser as it is, even if it is in the middle of the XHTML.

The quick fix is to remove the BOM, if your editor does not allow you to do so, a quick google search on removing UTF8 BOM can get you some script to remove BOM.

1 Comment »

  1. The BOM, UTF-8 and Rails at Joopp’s Blog said,

    March 16, 2009 @ 10:15 pm

    […] remove it check here and here! addthis_url = […]

RSS feed for comments on this post · TrackBack URI

Leave a Comment