<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marc Roberts &#187; Coding</title>
	<atom:link href="http://marcroberts.info/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://marcroberts.info</link>
	<description>Developer &#38; Web Nut</description>
	<lastBuildDate>Thu, 28 Jan 2010 12:08:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hyphenation in Rails</title>
		<link>http://marcroberts.info/2009/08/hyphenation-in-rails/</link>
		<comments>http://marcroberts.info/2009/08/hyphenation-in-rails/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 18:13:47 +0000</pubDate>
		<dc:creator>marcroberts</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://marcroberts.info/?p=9</guid>
		<description><![CDATA[In web application development we often come across the problem of user entered information (for example comments) potentially containing veryveryverylongwords which spew outside their box and cause our designer&#8217;s beautiful layout to look awful (and horrid in IE6).

In a recent Rails app I was working on I came across this problem, luckily everywhere we had [...]]]></description>
			<content:encoded><![CDATA[<p>In web application development we often come across the problem of user entered information (for example comments) potentially containing veryveryverylongwords which spew outside their box and cause our designer&#8217;s beautiful layout to look awful (and horrid in IE6).</p>
<p><span id="more-9"></span></p>
<p>In a recent Rails app I was working on I came across this problem, luckily everywhere we had this problem was in content being rendered using the <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001751">simple_format</a> text helper. So with a little bit of research (thanks <a href="http://ejohn.org/blog/injecting-word-breaks-with-javascript/">John Resig</a> and <a href="http://stackoverflow.com/questions/856307/wordwrap-a-very-long-string">Stackoverflow.com</a>) I came up with this simple solution:</p>
<p><script src="http://gist.github.com/177044.js"></script></p>
<p>There one serious caveat to using this, it will cause problems if you allow any html or other markup in your comment (we do not).</p>
<p>There is also a javascript solution to this problem which may be more suited to you, <a href="http://code.google.com/p/hyphenator/">Hyphenator</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcroberts.info/2009/08/hyphenation-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
