<?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>Agile Tortoise &#187; Ruby on Rails</title>
	<atom:link href="http://greg.agiletortoise.com/category/technology/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://greg.agiletortoise.com</link>
	<description>Greg Pierce's blog</description>
	<lastBuildDate>Thu, 04 Mar 2010 14:17:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>TAKScopes update</title>
		<link>http://greg.agiletortoise.com/2008/08/07/takscopes-update/</link>
		<comments>http://greg.agiletortoise.com/2008/08/07/takscopes-update/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 19:32:44 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[takscopes]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/?p=1835</guid>
		<description><![CDATA[
			
				
			
		
Just rolled out an update to TAKScopes, a Rails site I built for Rice University.
The site now allows for automatic guest login to view sample of the resources available, so you can browse a little more of the site without a paid account.  You still can&#8217;t see the admin interfaces, which is probably the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F08%2F07%2Ftakscopes-update%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F08%2F07%2Ftakscopes-update%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Just rolled out an update to <a href="http://www.takscopes.com/">TAKScopes</a>, a Rails site I built for Rice University.</p>
<p>The site now allows for automatic guest login to view sample of the resources available, so you can browse a little more of the site without a paid account.  You still can&#8217;t see the admin interfaces, which is probably the neatest aspect from a development point of view, but it&#8217;s still cool that you can see some of the content they are pushing out.  The site is getting a lot of users now, especially via ISDs all through the Houston area.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F08%2F07%2Ftakscopes-update%2F&amp;linkname=TAKScopes%20update" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F08%2F07%2Ftakscopes-update%2F&amp;linkname=TAKScopes%20update" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F08%2F07%2Ftakscopes-update%2F&amp;linkname=TAKScopes%20update" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F08%2F07%2Ftakscopes-update%2F&amp;linkname=TAKScopes%20update">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2008/08/07/takscopes-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tech refresh for the company site</title>
		<link>http://greg.agiletortoise.com/2008/05/07/tech-refresh-for-the-company-site/</link>
		<comments>http://greg.agiletortoise.com/2008/05/07/tech-refresh-for-the-company-site/#comments</comments>
		<pubDate>Wed, 07 May 2008 21:46:27 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/?p=1803</guid>
		<description><![CDATA[
			
				
			
		
With time that would probably have been better invested in actually improving the content of the site, I instead re-deployed my Agile Tortoise company website, in a far more buzzword compliant fashion.  That&#8217;s right, rather than running on Rails 1.1.6, behind FastCGI on Apache 1.3 on a shared host with code in Subversion and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F05%2F07%2Ftech-refresh-for-the-company-site%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F05%2F07%2Ftech-refresh-for-the-company-site%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>With time that would probably have been better invested in actually improving the content of the site, I instead re-deployed my <a href="http://www.agiletortoise.com/">Agile Tortoise company website</a>, in a far more buzzword compliant fashion.  That&#8217;s right, rather than running on Rails 1.1.6, behind FastCGI on Apache 1.3 on a shared host with code in Subversion and deployment courtesy of Capistrano 1.4.1 &#8212; It&#8217;s now under Git, updated to Rails 2.0.2, deployed with Capistrano 2.3 to a Ubuntu (Hardy Heron) VPS running Apache 2 with mod_rails.</p>
<p>So, ladies and gents, I&#8217;m serving up my stale content with style!  And, well, I&#8217;ve learned quite a bit in the process.  Git really rocks, too.  I can actually do functional and complex branching and merging it in, which I never mastered in Subversion.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F05%2F07%2Ftech-refresh-for-the-company-site%2F&amp;linkname=Tech%20refresh%20for%20the%20company%20site" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F05%2F07%2Ftech-refresh-for-the-company-site%2F&amp;linkname=Tech%20refresh%20for%20the%20company%20site" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F05%2F07%2Ftech-refresh-for-the-company-site%2F&amp;linkname=Tech%20refresh%20for%20the%20company%20site" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F05%2F07%2Ftech-refresh-for-the-company-site%2F&amp;linkname=Tech%20refresh%20for%20the%20company%20site">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2008/05/07/tech-refresh-for-the-company-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chronic &#8220;smart&#8221; date update</title>
		<link>http://greg.agiletortoise.com/2008/02/13/chronic-smart-date-update/</link>
		<comments>http://greg.agiletortoise.com/2008/02/13/chronic-smart-date-update/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 15:25:46 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2008/02/13/chronic-smart-date-update/</guid>
		<description><![CDATA[
			
				
			
		
b.logi.cx posted an elegant and more complete solution to incorporating Chronic date fields in your ActiveRecord models.  my version was certainly hack-ish.
I started on a simple helper plugin to use for AJAX previews of chronic&#8217;s parsing.  Hopefully I&#8217;ll have something release on that before too long.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F02%2F13%2Fchronic-smart-date-update%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F02%2F13%2Fchronic-smart-date-update%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>b.logi.cx posted an <a href="http://b.logi.cx/2008/2/8/gettin-less-icky-with-the-chronic">elegant and more complete solution</a> to incorporating Chronic date fields in your ActiveRecord models.  <a href="http://greg.agiletortoise.com/2008/01/23/rails-and-chronic-easy-smart-date-fields/">my version</a> was certainly hack-ish.</p>
<p>I started on a simple helper plugin to use for AJAX previews of chronic&#8217;s parsing.  Hopefully I&#8217;ll have something release on that before too long.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F02%2F13%2Fchronic-smart-date-update%2F&amp;linkname=Chronic%20%26%238220%3Bsmart%26%238221%3B%20date%20update" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F02%2F13%2Fchronic-smart-date-update%2F&amp;linkname=Chronic%20%26%238220%3Bsmart%26%238221%3B%20date%20update" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F02%2F13%2Fchronic-smart-date-update%2F&amp;linkname=Chronic%20%26%238220%3Bsmart%26%238221%3B%20date%20update" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F02%2F13%2Fchronic-smart-date-update%2F&amp;linkname=Chronic%20%26%238220%3Bsmart%26%238221%3B%20date%20update">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2008/02/13/chronic-smart-date-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails and Chronic, easy &#8217;smart&#8217; date fields</title>
		<link>http://greg.agiletortoise.com/2008/01/23/rails-and-chronic-easy-smart-date-fields/</link>
		<comments>http://greg.agiletortoise.com/2008/01/23/rails-and-chronic-easy-smart-date-fields/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 22:24:20 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2008/01/23/rails-and-chronic-easy-smart-date-fields/</guid>
		<description><![CDATA[
			
				
			
		
There are quite a few Ruby on Rails plugins to give you nice Calendar drop downs for date selection...but, I'm much more partial to the style of fuzzy date entry you see in a lot of apps now, allowing you to enter common strings and have the app figure out the date -- ie, "next [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F01%2F23%2Frails-and-chronic-easy-smart-date-fields%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F01%2F23%2Frails-and-chronic-easy-smart-date-fields%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>There are quite a few <a href="http://www.rubyonrails.org/">Ruby on Rails</a> plugins to give you nice Calendar drop downs for date selection...but, I'm much more partial to the style of fuzzy date entry you see in a lot of apps now, allowing you to enter common strings and have the app figure out the date -- ie, "next friday", "tomorrow", etc.  With a pointer from <a href="http://twitter.com/agile">Mike</a> yesterday to the excellent <a href="http://chronic.rubyforge.org/">Chronic</a> gem, I was on my way.</p>
<p>Chronic does all the hard work, just install it...</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gem install chronic </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Then, in your views, use a text_field for your date...</p>
<div class="igBar"><span id="lruby-5"><a href="#" onclick="javascript:showPlainTxt('ruby-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-5">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;% form_for :model <span style="color:#9966CC; font-weight:bold;">do</span> |f| %&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;% f.<span style="color:#9900CC;">text_field</span> :date_attr_name %&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;% <span style="color:#9966CC; font-weight:bold;">end</span> %&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In your model, you'll want to then use Chronic to parse the pre-cast value of the date attribute using the _before_type_cast methods...</p>
<div class="igBar"><span id="lruby-6"><a href="#" onclick="javascript:showPlainTxt('ruby-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-6">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'chronic'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">class</span> MyModel &lt;ActiveRecord::Base</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> before_save</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">date_attr_name</span> = Chronic.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">date_attr_name_before_type_cast</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">date_attr_name_before_type_cast</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I expect I'm going to find that I need to tweak this a little -- and I'm pretty sure I'll want to write a helper that will give the user a AJAX preview of the parsed date before the submit the form, but, it definitely beats the lousy Rails built-in date_select method.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F01%2F23%2Frails-and-chronic-easy-smart-date-fields%2F&amp;linkname=Rails%20and%20Chronic%2C%20easy%20%26%238217%3Bsmart%26%238217%3B%20date%20fields" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F01%2F23%2Frails-and-chronic-easy-smart-date-fields%2F&amp;linkname=Rails%20and%20Chronic%2C%20easy%20%26%238217%3Bsmart%26%238217%3B%20date%20fields" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F01%2F23%2Frails-and-chronic-easy-smart-date-fields%2F&amp;linkname=Rails%20and%20Chronic%2C%20easy%20%26%238217%3Bsmart%26%238217%3B%20date%20fields" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2008%2F01%2F23%2Frails-and-chronic-easy-smart-date-fields%2F&amp;linkname=Rails%20and%20Chronic%2C%20easy%20%26%238217%3Bsmart%26%238217%3B%20date%20fields">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2008/01/23/rails-and-chronic-easy-smart-date-fields/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TextMate syntax coloring and Rails 2.0</title>
		<link>http://greg.agiletortoise.com/2007/10/19/textmate-syntax-coloring-and-rails-20/</link>
		<comments>http://greg.agiletortoise.com/2007/10/19/textmate-syntax-coloring-and-rails-20/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 14:08:57 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/10/19/textmate-syntax-coloring-and-rails-20/</guid>
		<description><![CDATA[
			
				
			
		
Now that the Ruby on Rails 2.0 Preview Release is out, I'm playing around with it.  First thing I noticed, while minor, is that TextMate's syntax coloring for "HTML (Rails)" doesn't recognize the new view naming scheme.  "rhtml" is now replaced by "html.erb" as the file extension.
It's a simple fix, however.  Just [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F10%2F19%2Ftextmate-syntax-coloring-and-rails-20%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F10%2F19%2Ftextmate-syntax-coloring-and-rails-20%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Now that the <a href="http://weblog.rubyonrails.org/2007/9/30/rails-2-0-0-preview-release">Ruby on Rails 2.0 Preview Release</a> is out, I'm playing around with it.  First thing I noticed, while minor, is that TextMate's syntax coloring for "HTML (Rails)" doesn't recognize the new view naming scheme.  "rhtml" is now replaced by "html.erb" as the file extension.</p>
<p>It's a simple fix, however.  Just open up the Bundle Editor, go to the "Rails" bundle, then the "HTML (Rails)" language definition, and add 'erb' to the filetypes array on the second line.  Like:</p>
<div class="igBar"><span id="ljavascript-8"><a href="#" onclick="javascript:showPlainTxt('javascript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp;scopeName = <span style="color: #3366CC;">'text.html.ruby'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; fileTypes = <span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'rhtml'</span>, <span style="color: #3366CC;">'erb'</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F10%2F19%2Ftextmate-syntax-coloring-and-rails-20%2F&amp;linkname=TextMate%20syntax%20coloring%20and%20Rails%202.0" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F10%2F19%2Ftextmate-syntax-coloring-and-rails-20%2F&amp;linkname=TextMate%20syntax%20coloring%20and%20Rails%202.0" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F10%2F19%2Ftextmate-syntax-coloring-and-rails-20%2F&amp;linkname=TextMate%20syntax%20coloring%20and%20Rails%202.0" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F10%2F19%2Ftextmate-syntax-coloring-and-rails-20%2F&amp;linkname=TextMate%20syntax%20coloring%20and%20Rails%202.0">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/10/19/textmate-syntax-coloring-and-rails-20/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Haml</title>
		<link>http://greg.agiletortoise.com/2007/07/14/haml/</link>
		<comments>http://greg.agiletortoise.com/2007/07/14/haml/#comments</comments>
		<pubDate>Sun, 15 Jul 2007 01:55:54 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/07/14/haml/</guid>
		<description><![CDATA[
			
				
			
		
Haml looks like a nice alternative to ERb for Rails template coding.  I get tired of writing out ERb, but don't quite love Markaby either.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F07%2F14%2Fhaml%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F07%2F14%2Fhaml%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://haml.hamptoncatlin.com/tutorial/">Haml</a> looks like a nice alternative to ERb for Rails template coding.  I get tired of writing out ERb, but don't quite love <a href="http://redhanded.hobix.com/inspect/markabyForRails.html">Markaby</a> either.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F07%2F14%2Fhaml%2F&amp;linkname=Haml" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F07%2F14%2Fhaml%2F&amp;linkname=Haml" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F07%2F14%2Fhaml%2F&amp;linkname=Haml" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F07%2F14%2Fhaml%2F&amp;linkname=Haml">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/07/14/haml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lone Star RubyConf</title>
		<link>http://greg.agiletortoise.com/2007/06/21/lone-star-rubyconf/</link>
		<comments>http://greg.agiletortoise.com/2007/06/21/lone-star-rubyconf/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 15:53:10 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/06/21/lone-star-rubyconf/</guid>
		<description><![CDATA[
			
				
			
		
I just registered for Lone Star RubyConf in September.  Not quite the spectacular that RailsConf was, but I bet it will be a good focused 2 days of learning and networking.  Plus, I can crash at Sean's.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F06%2F21%2Flone-star-rubyconf%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F06%2F21%2Flone-star-rubyconf%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I just registered for <a href="http://lonestarrubyconf.com/">Lone Star RubyConf</a> in September.  Not quite the spectacular that RailsConf was, but I bet it will be a good focused 2 days of learning and networking.  Plus, I can crash at Sean's.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F06%2F21%2Flone-star-rubyconf%2F&amp;linkname=Lone%20Star%20RubyConf" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F06%2F21%2Flone-star-rubyconf%2F&amp;linkname=Lone%20Star%20RubyConf" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F06%2F21%2Flone-star-rubyconf%2F&amp;linkname=Lone%20Star%20RubyConf" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F06%2F21%2Flone-star-rubyconf%2F&amp;linkname=Lone%20Star%20RubyConf">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/06/21/lone-star-rubyconf/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RailsBrain</title>
		<link>http://greg.agiletortoise.com/2007/05/25/railsbrain/</link>
		<comments>http://greg.agiletortoise.com/2007/05/25/railsbrain/#comments</comments>
		<pubDate>Fri, 25 May 2007 17:56:45 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/05/25/railsbrain/</guid>
		<description><![CDATA[
			
				
			
		
Aaaaah, a kinder, gentler way to browse the Rails API docs.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F25%2Frailsbrain%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F25%2Frailsbrain%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Aaaaah, a kinder, gentler way to <a href="http://railsbrain.com/">browse the Rails API docs</a>.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F25%2Frailsbrain%2F&amp;linkname=RailsBrain" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F25%2Frailsbrain%2F&amp;linkname=RailsBrain" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F25%2Frailsbrain%2F&amp;linkname=RailsBrain" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F25%2Frailsbrain%2F&amp;linkname=RailsBrain">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/05/25/railsbrain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TAKScopes</title>
		<link>http://greg.agiletortoise.com/2007/05/16/takscopes/</link>
		<comments>http://greg.agiletortoise.com/2007/05/16/takscopes/#comments</comments>
		<pubDate>Wed, 16 May 2007 11:54:56 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/05/16/takscopes/</guid>
		<description><![CDATA[
			
				
			
		
Though a few details are still being worked out, the latest Ruby on Rails project I've been working on has been launched.  Called TAKScopes, the site is a teaching resource site for primary level educators in Texas -- created by the Science Science and Technology Department at Rice University.
Unfortunately, from a personal point of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F16%2Ftakscopes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F16%2Ftakscopes%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Though a few details are still being worked out, the latest Ruby on Rails project I've been working on has been launched.  Called <a href="http://www.takscopes.com/">TAKScopes</a>, the site is a teaching resource site for primary level educators in Texas -- created by the Science Science and Technology Department at Rice University.</p>
<p>Unfortunately, from a personal point of view, the interesting parts for me to show off are all behind logins.  The site has a complete custom CMS that allows the Rice staff to create/edit/manage all their content.</p>
<p>It's been a fun project, not the least of which because it's been the first one I've gotten to work on with my good friend <a href="http://graphic-action.com/">Jamie Pritchett</a>, who did the design and Flash work.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F16%2Ftakscopes%2F&amp;linkname=TAKScopes" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F16%2Ftakscopes%2F&amp;linkname=TAKScopes" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F16%2Ftakscopes%2F&amp;linkname=TAKScopes" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F05%2F16%2Ftakscopes%2F&amp;linkname=TAKScopes">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/05/16/takscopes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails: flatten your content model with single-table inheritance and alias_attribute</title>
		<link>http://greg.agiletortoise.com/2007/04/02/rails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute/</link>
		<comments>http://greg.agiletortoise.com/2007/04/02/rails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 03:34:43 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/04/02/rails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute/</guid>
		<description><![CDATA[
			
				
			
		
I'm currently working on a Ruby on Rails app with a very deep content model.  There are many different "same-but-different" types of content to be managed.  The "same" parts are roughly similar structure, like simple list items.  The "different" parts are usually more meta-data oriented, such as different field labels.
I didn't want [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F04%2F02%2Frails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F04%2F02%2Frails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I'm currently working on a <a href="http://www.rubyonrails.com">Ruby on Rails</a> app with a very deep content model.  There are many different "same-but-different" types of content to be managed.  The "same" parts are roughly similar structure, like simple list items.  The "different" parts are usually more meta-data oriented, such as different field labels.</p>
<p>I didn't want to end up with dozens of tables in the db for all these types.  I also liked the idea of being able to easily search across them content types, so a relatively flat db structure would facilitate that.</p>
<p>My solution?  Create a single table with some generic content holding fields something like the following:</p>
<div class="igBar"><span id="lruby-11"><a href="#" onclick="javascript:showPlainTxt('ruby-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-11">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#migration</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">class</span> CreateListItems &lt;ActiveRecord::Migration</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">up</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; create_table :list_items <span style="color:#9966CC; font-weight:bold;">do</span> |t|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; t.<span style="color:#9900CC;">column</span> <img src='http://greg.agiletortoise.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> wner_id, :<span style="color:#CC0066; font-weight:bold;">integer</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; t.<span style="color:#9900CC;">column</span> :type, :<span style="color:#CC0066; font-weight:bold;">string</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; t.<span style="color:#9900CC;">column</span> :text, :text</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; t.<span style="color:#9900CC;">column</span> :text2, :text</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">down</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; drop_table :list_items</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># model</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">class</span> ListItem &lt;ActiveRecord::Base</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; validates_presence_of :text&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now, for the various content types, use single-table inheritance to let all the models track back to the same table (the "type" field above is necessary for this to work).  Also, to make the attributes match your content types, use an alias_attribute call to map the attribute names to the generic ones in the parent table.  Such as:</p>
<div class="igBar"><span id="lruby-12"><a href="#" onclick="javascript:showPlainTxt('ruby-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-12">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">class</span> Question &lt;ListItem</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; alias_attribute :question, :text</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; alias_attribute :answer, :text2</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now you'll be able interact with the Question instances naturally (q.question=, q.answer=), and any other content types you derive from ListItem.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F04%2F02%2Frails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute%2F&amp;linkname=Rails%3A%20flatten%20your%20content%20model%20with%20single-table%20inheritance%20and%20alias_attribute" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F04%2F02%2Frails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute%2F&amp;linkname=Rails%3A%20flatten%20your%20content%20model%20with%20single-table%20inheritance%20and%20alias_attribute" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F04%2F02%2Frails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute%2F&amp;linkname=Rails%3A%20flatten%20your%20content%20model%20with%20single-table%20inheritance%20and%20alias_attribute" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F04%2F02%2Frails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute%2F&amp;linkname=Rails%3A%20flatten%20your%20content%20model%20with%20single-table%20inheritance%20and%20alias_attribute">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/04/02/rails-flatten-your-content-model-with-single-table-inheritance-and-alias_attribute/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rails: model == file</title>
		<link>http://greg.agiletortoise.com/2007/03/14/rails-model-file/</link>
		<comments>http://greg.agiletortoise.com/2007/03/14/rails-model-file/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 03:10:01 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/03/14/rails-model-file/</guid>
		<description><![CDATA[
			
				
			
		
If you're thinking about saving yourself a few files by placing a couple of model classes in the same file in your Rails app, think again.  It seems that Rails load structure (at least in recent versions) will puke on that setup.
I was using Single Table Inheritance, and it seems a good idea -- [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F14%2Frails-model-file%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F14%2Frails-model-file%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you're thinking about saving yourself a few files by placing a couple of model classes in the same file in your Rails app, think again.  It seems that Rails load structure (at least in recent versions) will puke on that setup.</p>
<p>I was using <a href="http://wiki.rubyonrails.org/rails/pages/SingleTableInheritance">Single Table Inheritance</a>, and it seems a good idea -- instead I spent a hour troubleshooting an "uninitialized constant" error.  Once I split the classes into their own model files I was fine.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F14%2Frails-model-file%2F&amp;linkname=Rails%3A%20model%20%3D%3D%20file" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F14%2Frails-model-file%2F&amp;linkname=Rails%3A%20model%20%3D%3D%20file" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F14%2Frails-model-file%2F&amp;linkname=Rails%3A%20model%20%3D%3D%20file" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F14%2Frails-model-file%2F&amp;linkname=Rails%3A%20model%20%3D%3D%20file">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/03/14/rails-model-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rails: content_tag block fix</title>
		<link>http://greg.agiletortoise.com/2007/03/01/rails-content_tag-block-fix/</link>
		<comments>http://greg.agiletortoise.com/2007/03/01/rails-content_tag-block-fix/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 03:44:50 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/03/01/rails-content_tag-block-fix/</guid>
		<description><![CDATA[
			
				
			
		
Currently (as of 1.2.2), Ruby on Rails useful content_tag method fails if you try to pass a block to it in code.  The following syntax works in a view template:
PLAIN TEXT
RUBY:




&#60;% content_for&#40;'div'&#41; do %&#62;


this is the &#60;b&#62;div content&#38;lt;/b&#62;.


&#60;% end %&#62; 






But, if you try to do the equivalent in ruby code (like in a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F01%2Frails-content_tag-block-fix%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F01%2Frails-content_tag-block-fix%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Currently (as of 1.2.2), Ruby on Rails useful <a href="http://api.rubyonrails.com/classes/ActionView/Helpers/CaptureHelper.html#M000638">content_tag</a> method fails if you try to pass a block to it in code.  The following syntax works in a view template:</p>
<div class="igBar"><span id="lruby-16"><a href="#" onclick="javascript:showPlainTxt('ruby-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-16">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;% content_for<span style="color:#006600; font-weight:bold;">&#40;</span>'div'<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> %&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">this is the &lt;b&gt;div content&amp;lt;/b&gt;.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;% <span style="color:#9966CC; font-weight:bold;">end</span> %&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>But, if you try to do the equivalent in ruby code (like in a helper), such as the below, it tanks:</p>
<div class="igBar"><span id="lruby-17"><a href="#" onclick="javascript:showPlainTxt('ruby-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-17">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">content_for<span style="color:#006600; font-weight:bold;">&#40;</span>'div'<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;'this is the &amp;lt;b&gt;div content&amp;lt;/b&gt;'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>While I'm far from an expert on Ruby details, I did a little re-write of the method.  If you drop the following in your application_helper (or other place of your choice) you'll get a fully functional version:</p>
<div class="igBar"><span id="lruby-18"><a href="#" onclick="javascript:showPlainTxt('ruby-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-18">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> content_tag<span style="color:#006600; font-weight:bold;">&#40;</span>name, content_or_options_with_block = <span style="color:#0000FF; font-weight:bold;">nil</span>, options = <span style="color:#0000FF; font-weight:bold;">nil</span>, &amp;block<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> block_given?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; options = content_or_options_with_block <span style="color:#9966CC; font-weight:bold;">if</span> content_or_options_with_block.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>Hash<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; content = block.<span style="color:#9900CC;">call</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; content = content_or_options_with_block</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; content_tag_string<span style="color:#006600; font-weight:bold;">&#40;</span>name, content, options<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F01%2Frails-content_tag-block-fix%2F&amp;linkname=Rails%3A%20content_tag%20block%20fix" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F01%2Frails-content_tag-block-fix%2F&amp;linkname=Rails%3A%20content_tag%20block%20fix" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F01%2Frails-content_tag-block-fix%2F&amp;linkname=Rails%3A%20content_tag%20block%20fix" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F03%2F01%2Frails-content_tag-block-fix%2F&amp;linkname=Rails%3A%20content_tag%20block%20fix">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/03/01/rails-content_tag-block-fix/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Dallas.rb, now with Dave Thomas!</title>
		<link>http://greg.agiletortoise.com/2007/02/27/dallasrb-now-with-dave-thomas/</link>
		<comments>http://greg.agiletortoise.com/2007/02/27/dallasrb-now-with-dave-thomas/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 04:00:55 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Dallas.rb]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/02/27/dallasrb-now-with-dave-thomas/</guid>
		<description><![CDATA[
			
				
			
		
The March Dallas.rb meeting will feature the Dave Thomas speaking on Metaprogramming in Ruby.  Dave literally wrote the book on Ruby, and also Rails.  He's also an excellent speaker.  
The Dallas.rb crew has worked out special digs for this meeting, with refreshments, etc, so if you're in the DFW area and have [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F27%2Fdallasrb-now-with-dave-thomas%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F27%2Fdallasrb-now-with-dave-thomas%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The March <a href="http://dallasrb.stikipad.com/wiki/">Dallas.rb meeting</a> will feature <em>the</em> Dave Thomas speaking on Metaprogramming in Ruby.  Dave literally wrote the book on Ruby, and also Rails.  He's also an excellent speaker.  </p>
<p>The Dallas.rb crew has worked out special digs for this meeting, with refreshments, etc, so if you're in the DFW area and have the slightess interest in programming, you would probably find this a worthwhile evening...so come on down.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F27%2Fdallasrb-now-with-dave-thomas%2F&amp;linkname=Dallas.rb%2C%20now%20with%20Dave%20Thomas%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F27%2Fdallasrb-now-with-dave-thomas%2F&amp;linkname=Dallas.rb%2C%20now%20with%20Dave%20Thomas%21" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F27%2Fdallasrb-now-with-dave-thomas%2F&amp;linkname=Dallas.rb%2C%20now%20with%20Dave%20Thomas%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F27%2Fdallasrb-now-with-dave-thomas%2F&amp;linkname=Dallas.rb%2C%20now%20with%20Dave%20Thomas%21">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/02/27/dallasrb-now-with-dave-thomas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django vs. Rails</title>
		<link>http://greg.agiletortoise.com/2007/02/25/django-vs-rails/</link>
		<comments>http://greg.agiletortoise.com/2007/02/25/django-vs-rails/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 03:43:40 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[PyCon]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/02/25/django-vs-rails/</guid>
		<description><![CDATA[
			
				
			
		
I posted some comments RE: Django over at Jim's blog.  I was planning to post some comments here, but the timing of his post prompted me.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F25%2Fdjango-vs-rails%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F25%2Fdjango-vs-rails%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I posted some comments RE: Django over at <a href="http://jim.roepcke.com/7642">Jim's blog</a>.  I was planning to post some comments here, but the timing of his post prompted me.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F25%2Fdjango-vs-rails%2F&amp;linkname=Django%20vs.%20Rails" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F25%2Fdjango-vs-rails%2F&amp;linkname=Django%20vs.%20Rails" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F25%2Fdjango-vs-rails%2F&amp;linkname=Django%20vs.%20Rails" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F25%2Fdjango-vs-rails%2F&amp;linkname=Django%20vs.%20Rails">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/02/25/django-vs-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Rails project</title>
		<link>http://greg.agiletortoise.com/2007/02/20/new-rails-project/</link>
		<comments>http://greg.agiletortoise.com/2007/02/20/new-rails-project/#comments</comments>
		<pubDate>Tue, 20 Feb 2007 22:28:28 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2007/02/20/new-rails-project/</guid>
		<description><![CDATA[
			
				
			
		
Well, after using it for personal applications, skunk works projects that I haven't had time to actually launch, and my consulting site -- I just got the go ahead on my first professional Ruby on Rails project!
I'm really excited about it because it's also a first co-venture with Jamie, a good friend and awesome designer. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F20%2Fnew-rails-project%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F20%2Fnew-rails-project%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Well, after using it for personal applications, skunk works projects that I haven't had time to actually launch, and my <a href="http://agiletortoise.com">consulting site</a> -- I just got the go ahead on my first professional <a href="http://www.rubyonrails.com/">Ruby on Rails</a> project!</p>
<p>I'm really excited about it because it's also a first co-venture with Jamie, a good friend and awesome designer.  More details will emerge in the coming months.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F20%2Fnew-rails-project%2F&amp;linkname=New%20Rails%20project" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F20%2Fnew-rails-project%2F&amp;linkname=New%20Rails%20project" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F20%2Fnew-rails-project%2F&amp;linkname=New%20Rails%20project" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2007%2F02%2F20%2Fnew-rails-project%2F&amp;linkname=New%20Rails%20project">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2007/02/20/new-rails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Castle project</title>
		<link>http://greg.agiletortoise.com/2006/11/22/castle-project/</link>
		<comments>http://greg.agiletortoise.com/2006/11/22/castle-project/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 13:30:32 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2006/11/22/castle-project/</guid>
		<description><![CDATA[
			
				
			
		
Since I seem to stuck in .NET land a lot these days, I think I'll be looking at the Castle project a bit more closely.  It has implementations for .NET that mimic the MVC and ActiveRecord setup in Rails.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F11%2F22%2Fcastle-project%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F11%2F22%2Fcastle-project%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Since I seem to stuck in .NET land a lot these days, I think I'll be looking at the <a href="http://www.castleproject.org/">Castle project</a> a bit more closely.  It has implementations for .NET that mimic the MVC and ActiveRecord setup in Rails.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F11%2F22%2Fcastle-project%2F&amp;linkname=Castle%20project" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F11%2F22%2Fcastle-project%2F&amp;linkname=Castle%20project" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F11%2F22%2Fcastle-project%2F&amp;linkname=Castle%20project" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F11%2F22%2Fcastle-project%2F&amp;linkname=Castle%20project">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2006/11/22/castle-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adam Keys at RubyConf</title>
		<link>http://greg.agiletortoise.com/2006/10/24/adam-keys-at-rubyconf/</link>
		<comments>http://greg.agiletortoise.com/2006/10/24/adam-keys-at-rubyconf/#comments</comments>
		<pubDate>Tue, 24 Oct 2006 13:14:10 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2006/10/24/adam-keys-at-rubyconf/</guid>
		<description><![CDATA[
			
				
			
		
Dallas Ruby Brigade founder, Adam Keys, at RubyConf.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F10%2F24%2Fadam-keys-at-rubyconf%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F10%2F24%2Fadam-keys-at-rubyconf%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://dallasrb.stikipad.com/wiki/show/HomePage">Dallas Ruby Brigade</a> founder, Adam Keys, <a href="http://nubyonrails.com/articles/2006/10/24/adam-keys-ussruby-sketch-from-rubyconf-2006">at RubyConf</a>.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F10%2F24%2Fadam-keys-at-rubyconf%2F&amp;linkname=Adam%20Keys%20at%20RubyConf" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F10%2F24%2Fadam-keys-at-rubyconf%2F&amp;linkname=Adam%20Keys%20at%20RubyConf" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F10%2F24%2Fadam-keys-at-rubyconf%2F&amp;linkname=Adam%20Keys%20at%20RubyConf" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F10%2F24%2Fadam-keys-at-rubyconf%2F&amp;linkname=Adam%20Keys%20at%20RubyConf">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2006/10/24/adam-keys-at-rubyconf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unobtrusive Javascript for Ruby On Rails</title>
		<link>http://greg.agiletortoise.com/2006/09/16/unobtrusive-javascript-for-ruby-on-rails/</link>
		<comments>http://greg.agiletortoise.com/2006/09/16/unobtrusive-javascript-for-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 17 Sep 2006 02:14:29 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2006/09/16/unobtrusive-javascript-for-ruby-on-rails/</guid>
		<description><![CDATA[
			
				
			
		
UJS Rails Plugin looks like very cool stuff.  I'll have to get back to this one.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F16%2Funobtrusive-javascript-for-ruby-on-rails%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F16%2Funobtrusive-javascript-for-ruby-on-rails%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.ujs4rails.com/">UJS Rails Plugin</a> looks like very cool stuff.  I'll have to get back to this one.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F16%2Funobtrusive-javascript-for-ruby-on-rails%2F&amp;linkname=Unobtrusive%20Javascript%20for%20Ruby%20On%20Rails" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F16%2Funobtrusive-javascript-for-ruby-on-rails%2F&amp;linkname=Unobtrusive%20Javascript%20for%20Ruby%20On%20Rails" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F16%2Funobtrusive-javascript-for-ruby-on-rails%2F&amp;linkname=Unobtrusive%20Javascript%20for%20Ruby%20On%20Rails" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F16%2Funobtrusive-javascript-for-ruby-on-rails%2F&amp;linkname=Unobtrusive%20Javascript%20for%20Ruby%20On%20Rails">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2006/09/16/unobtrusive-javascript-for-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fear, Uncertainty, and Doubt</title>
		<link>http://greg.agiletortoise.com/2006/09/01/fear-uncertain-and-doubt/</link>
		<comments>http://greg.agiletortoise.com/2006/09/01/fear-uncertain-and-doubt/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 20:00:35 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2006/09/01/fear-uncertain-and-doubt/</guid>
		<description><![CDATA[
			
				
			
		
DHH's comments on Joel Spolsky's latest are pretty dern funny.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F01%2Ffear-uncertain-and-doubt%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F01%2Ffear-uncertain-and-doubt%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>DHH's <a href="http://feeds.feedburner.com/~r/LoudThinking/~3/18244660/000596.html">comments on Joel Spolsky's latest</a> are pretty dern funny.</p>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F01%2Ffear-uncertain-and-doubt%2F&amp;linkname=Fear%2C%20Uncertainty%2C%20and%20Doubt" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F01%2Ffear-uncertain-and-doubt%2F&amp;linkname=Fear%2C%20Uncertainty%2C%20and%20Doubt" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F01%2Ffear-uncertain-and-doubt%2F&amp;linkname=Fear%2C%20Uncertainty%2C%20and%20Doubt" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F09%2F01%2Ffear-uncertain-and-doubt%2F&amp;linkname=Fear%2C%20Uncertainty%2C%20and%20Doubt">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2006/09/01/fear-uncertain-and-doubt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set base path for Rails app</title>
		<link>http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/</link>
		<comments>http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/#comments</comments>
		<pubDate>Thu, 24 Aug 2006 01:56:05 +0000</pubDate>
		<dc:creator>greg</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/</guid>
		<description><![CDATA[
			
				
			
		
After a bit of searching, I finally figured out how to force Rails to use a particular base path when generating url via any of the various methods that pass through "url_for."  Add the following line to your environment.rb file:


ActionController::AbstractRequest.relative_url_root = "/[basepath]"


]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F08%2F23%2Fset-base-path-for-rails-app%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F08%2F23%2Fset-base-path-for-rails-app%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>After a bit of searching, I finally figured out how to force Rails to use a particular base path when generating url via any of the various methods that pass through "url_for."  Add the following line to your environment.rb file:</p>
<div class="codeblock"><code>
<pre>
ActionController::AbstractRequest.relative_url_root = "/[basepath]"
</pre>
<p></code></div>
<p><a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F08%2F23%2Fset-base-path-for-rails-app%2F&amp;linkname=Set%20base%20path%20for%20Rails%20app" title="Twitter" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F08%2F23%2Fset-base-path-for-rails-app%2F&amp;linkname=Set%20base%20path%20for%20Rails%20app" title="Facebook" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F08%2F23%2Fset-base-path-for-rails-app%2F&amp;linkname=Set%20base%20path%20for%20Rails%20app" title="Delicious" rel="nofollow" target="_blank"><img src="http://greg.agiletortoise.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fgreg.agiletortoise.com%2F2006%2F08%2F23%2Fset-base-path-for-rails-app%2F&amp;linkname=Set%20base%20path%20for%20Rails%20app">Share/Bookmark</a> </p>]]></content:encoded>
			<wfw:commentRss>http://greg.agiletortoise.com/2006/08/23/set-base-path-for-rails-app/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
