<?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>Burm.net &#187; ruby</title>
	<atom:link href="http://burm.net/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://burm.net</link>
	<description>John Burmeister's Blog</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:31:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ruby on Rails Best Coding Practices Slide Show and Gem</title>
		<link>http://burm.net/2009/11/17/rails-best-coding-practices-slide-show-and-gem/</link>
		<comments>http://burm.net/2009/11/17/rails-best-coding-practices-slide-show-and-gem/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 01:54:39 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Rails Plugins]]></category>
		<category><![CDATA[Rails Tutorials]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://burm.net/?p=249</guid>
		<description><![CDATA[When browsing around today I saw quite a few sites talking about the Rails Best Practices presentation / talk that ihower did at the Kungfu RailsConf. Check it below, it really covers a lot of basic tips on how to clean up your code and follow some better coding practices. Someone just released a gem [...]]]></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%2Fburm.net%2F2009%2F11%2F17%2Frails-best-coding-practices-slide-show-and-gem%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2009%2F11%2F17%2Frails-best-coding-practices-slide-show-and-gem%2F&amp;source=burmjohn&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>When browsing around today I saw quite a few sites talking about the Rails Best Practices presentation / talk that ihower did at the Kungfu RailsConf. Check it below, it really covers a lot of basic tips on how to clean up your code and follow some better coding practices.</p>
<p>Someone just released a gem that will analyze your code and check for &#8220;Best Practices&#8221; -  seems promising. Check it out at GitHub here: <a href="http://github.com/flyerhzm/rails_best_practices">http://github.com/flyerhzm/rails_best_practices</a></p>
<div id="__ss_2334123" style="width: 425px; text-align: left;"><object style="margin:0px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rails-best-practices-091024015011-phpapp01&amp;stripped_title=rails-best-practices" /><param name="allowfullscreen" value="true" /><embed style="margin:0px" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rails-best-practices-091024015011-phpapp01&amp;stripped_title=rails-best-practices" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2009/11/17/rails-best-coding-practices-slide-show-and-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Ruby On Rails Tip for Nested Resources</title>
		<link>http://burm.net/2008/11/01/quick-ruby-on-rails-quick-tip-for-nested-resources/</link>
		<comments>http://burm.net/2008/11/01/quick-ruby-on-rails-quick-tip-for-nested-resources/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 00:33:59 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[Remodeling]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://burm.net/?p=178</guid>
		<description><![CDATA[Just a quick tip for when you are doing nested resources&#8230;. In this example, I am building a app for a client where there is a recipient and they have many physicians. So I have a case where I have a nested resource. To keep thing DRY, I added this to my before filter where [...]]]></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%2Fburm.net%2F2008%2F11%2F01%2Fquick-ruby-on-rails-quick-tip-for-nested-resources%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2008%2F11%2F01%2Fquick-ruby-on-rails-quick-tip-for-nested-resources%2F&amp;source=burmjohn&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Just a quick tip for when you are doing nested resources&#8230;.</p>
<p>In this example, I am building a app for a client where there is a recipient and they have many physicians.  So I have a case where I have a nested resource.  To keep thing DRY, I added this to my before filter where I get the recipient. This allows you to nuke the find in the show, edit, update and delete actions and retain the original use of @physician.  </p>
<pre>
def get_recipient
  @recipient = Recipient.find(params[:recipient_id])
  # DRYs her up a little so you don't have a find in the show,edit,update and delete actions
  @physician = @recipient.physicians.find(params[:id]) if params[:id]
end
</pre>
<p>Don&#8217;t forget to modify your index find, change it to reflect the nested route&#8230; In my case:</p>
<pre>
    @physicians = @recipient.physicians.find(:all)
</pre>
<p>Have any other useful tips? Let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2008/11/01/quick-ruby-on-rails-quick-tip-for-nested-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

