<?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>Push cx &#187; xhtml</title>
	<atom:link href="http://push.cx/tag/xhtml/feed" rel="self" type="application/rss+xml" />
	<link>http://push.cx</link>
	<description>A traveling geek&#039;s blog on development, games, and the web</description>
	<lastBuildDate>Thu, 19 Apr 2012 20:39:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Making Valid XHTML Easier</title>
		<link>http://push.cx/2006/making-valid-xhtml-easier</link>
		<comments>http://push.cx/2006/making-valid-xhtml-easier#comments</comments>
		<pubDate>Tue, 14 Nov 2006 23:14:19 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://push.cx/2006/making-valid-xhtml-easier</guid>
		<description><![CDATA[I&#8217;m working on a Rails site in my Copious Free Time and I wanted to share a little way that Ruby made my life easier. I&#8217;m making my pages valid XHTML 1.0 Transitional because it makes life easier to find bugs and it just feels good to know I&#8217;m meeting the spec. The W3C Validator [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;m working on a Rails site in my <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NhdGIub3JnL2phcmdvbi9odG1sL0MvY29waW91cy1mcmVlLXRpbWUuaHRtbA==">Copious Free Time</a> and I wanted to share a little way that Ruby made my life easier. I&#8217;m making my pages valid XHTML 1.0 Transitional because it makes life easier to find bugs and it just feels <i>good</i> to know I&#8217;m meeting the spec.
<p>

<p>
The <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZhbGlkYXRvci53My5vcmcv">W3C Validator</a> complained that I didn&#8217;t have the <kbd>rows</kbd> and <kbd>cols</kbd> attributes on my <kbd>&lt;textarea&gt;</kbd> tags. My code for them looked like:
</p>

<pre>&nbsp;
&lt;%= text_area_tag :message, params<span style="color: #66cc66;">&#91;</span>:message<span style="color: #66cc66;">&#93;</span> %&gt;</pre>

<p>
And I don&#8217;t want to add the <kbd>:size</kbd> option because I use CSS to style all of them, it&#8217;d be confusing to see an unused size there. So I extended the <kbd>text_area_tag</kbd> method in my <kbd>app/helpers/application_helper.rb</kbd> to fill in a default:
</p>

<pre>&nbsp;
module ApplicationHelper
  def text_area_tag<span style="color: #66cc66;">&#40;</span>name, content=nil, options=<span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
    super<span style="color: #66cc66;">&#40;</span>name, content, <span style="color: #66cc66;">&#123;</span> :size =&gt; <span style="color: #ff0000;">"40x10"</span> <span style="color: #66cc66;">&#125;</span>.<span style="">update</span><span style="color: #66cc66;">&#40;</span>options<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #b1b100;">end</span>
end</pre>

<p>
And it was that easy to start having valid tags. I&#8217;ll be posting more Rails snippets and tips as I work on my project, and I&#8217;ll definitely announce here when it&#8217;s ready for wide release.
</p>

<p>
(This snippet owes thanks to &#8216;leethal&#8217; in #rubyonrails on <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZyZWVub2RlLm5ldA==">irc.freenode.net</a> for straightening out how I was trying to override the method.)
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=190" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/making-valid-xhtml-easier/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

