<?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; Rails Tutorials</title>
	<atom:link href="http://burm.net/tag/rails-tutorials/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>Acts As Taggable on Steroids Ruby On Rails Plugin With Paginate</title>
		<link>http://burm.net/2008/10/08/acts-as-taggable-on-steroids-ruby-on-rails-plugin-with-paginate/</link>
		<comments>http://burm.net/2008/10/08/acts-as-taggable-on-steroids-ruby-on-rails-plugin-with-paginate/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 05:48:33 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Rails Plugins]]></category>
		<category><![CDATA[Rails Tutorials]]></category>

		<guid isPermaLink="false">http://burm.net/?p=133</guid>
		<description><![CDATA[Acts As Taggable On Steroids is a great plugin for Rails that makes adding tags to your application quick and easy. Check it out on github here => http://github.com/mattetti/acts_as_taggable_on_steroids/tree/master I threw this post together with some notes that I took along the way when setting up the plugin for use. Installation: script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids Setup [...]]]></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%2F10%2F08%2Facts-as-taggable-on-steroids-ruby-on-rails-plugin-with-paginate%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2008%2F10%2F08%2Facts-as-taggable-on-steroids-ruby-on-rails-plugin-with-paginate%2F&amp;source=burmjohn&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Acts As Taggable On Steroids is a great plugin for Rails that makes adding tags to your application quick and easy.  Check it out on github here => <a href="http://github.com/mattetti/acts_as_taggable_on_steroids/tree/master">http://github.com/mattetti/acts_as_taggable_on_steroids/tree/master</a></p>
<p>I threw this post together with some notes that I took along the way when setting up the plugin for use. </p>
<p><strong>Installation:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>plugin install http:<span style="color:#006600; font-weight:bold;">//</span>svn.<span style="color:#9900CC;">viney</span>.<span style="color:#9900CC;">net</span>.<span style="color:#9900CC;">nz</span><span style="color:#006600; font-weight:bold;">/</span>things<span style="color:#006600; font-weight:bold;">/</span>rails<span style="color:#006600; font-weight:bold;">/</span>plugins<span style="color:#006600; font-weight:bold;">/</span>acts_as_taggable_on_steroids</pre></div></div>

<p><strong>Setup</strong></p>
<p>Setup your migration by running the below:</p>
<pre lang ="rails">
ruby script/generate acts_as_taggable_migration
rake db:migrate
</pre>
<p>Add the acts_as_taggable to your model, in my case its the Events model&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Event <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC00FF; font-weight:bold;"><span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span></span>
<span style="color:#008000; font-style:italic;"># acts as taggable on roids</span>
acts_as_taggable</pre></div></div>

<p>Now I needed to add a way to allow tags to be added to Events, in my form for my Event I added the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;
  &lt;%= f.label 'Tag List (Delimiter = ,)' %&gt;&lt;br /&gt;
  &lt;%= f.text_field :tag_list %&gt;
&lt;/p&gt;</pre></div></div>

<p>To view the tags associated this a Event on the Show page, along with linking to the actual tag to search for other events tagged with the same item, I added the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;&lt;strong&gt;This event was tagged with&lt;/strong&gt;: &lt;% for tag in @event.tags %&gt; 
&lt;%= link_to tag.name, events_path(:view =&gt;'tag', :tag =&gt; tag.name) %&gt;&lt;% end %&gt;
&lt;/p&gt;</pre></div></div>

<p><strong>Tag Clouds </strong></p>
<p>In order to use the plugin&#8217;s build in tag cloud functionality you need to add the helper to your application helper by doing the following:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">module</span> ApplicationHelper
    <span style="color:#9966CC; font-weight:bold;">include</span> TagsHelper
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>In your controller where you are planning on using your tag cloud add the below, this will grab the counts of all your tags so the helper can generate your cloud. Again in my case I am putting this in my Events controller.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#0066ff; font-weight:bold;">@tags</span> = Event.<span style="color:#9900CC;">tag_counts</span></pre></div></div>

<p>Now you use the following where you wish to show your views:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> tag_cloud <span style="color:#0066ff; font-weight:bold;">@tags</span>, <span style="color:#006600; font-weight:bold;">%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span>tag1 tag2 tag3 tag4<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>tag, css_class<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    <span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#5A0A0A; font-weight:bold;">link_to</span> <span style="color:#5A0A0A; font-weight:bold;">tag</span>.<span style="color:#9900CC;">name</span>, <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:action</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> :<span style="color:#5A0A0A; font-weight:bold;">tag</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#5A0A0A; font-weight:bold;">tag</span>.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">&#125;</span>, :<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> css_class <span style="color:#006600; font-weight:bold;">%&gt;</span>
  <span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>In your main CSS file you should add something to match the tags we specified above, this sets your font sizes for the cloud display generated by the helper&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">  <span style="color: #6666ff;">.tag1</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.0em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.tag2</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.6em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.tag3</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2.7em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
  <span style="color: #6666ff;">.tag4</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3.8em</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><strong>Tag Clouds with Paginate Example</strong></p>
<p>Here I am passing the page and tag to my events model to find all events tagged with that tag, and then use the results of that query and passing it onto paginate.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">tag_event_list</span><span style="color:#006600; font-weight:bold;">&#40;</span>page, <span style="color:#5A0A0A; font-weight:bold;">tag</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
 options = Event.<span style="color:#9900CC;">find_options_for_find_tagged_with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#5A0A0A; font-weight:bold;">tag</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">merge</span> <span style="color:#ff3333; font-weight:bold;">:page</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> page, <span style="color:#ff3333; font-weight:bold;">:per_page</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">10</span>, <span style="color:#ff3333; font-weight:bold;">:order</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'date DESC'</span> 
 <span style="color:#5A0A0A; font-weight:bold;">paginate</span><span style="color:#006600; font-weight:bold;">&#40;</span>options<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Other Notes:</p>
<p>I added the following to my environment.rb file so that the unused tags get destroyed if they are no longer in use by any events.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># automatically remove dead tags</span>
Tag.<span style="color:#9900CC;">destroy_unused</span> = <span style="color:#0000FF; font-weight:bold;">true</span></pre></div></div>

<p>For more help check out the read me here: <a href="http://github.com/mattetti/acts_as_taggable_on_steroids/tree/master">http://github.com/mattetti/acts_as_taggable_on_steroids/tree/maste</a>r</p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2008/10/08/acts-as-taggable-on-steroids-ruby-on-rails-plugin-with-paginate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A few great plugins that I am using in my current Ruby on Rails project</title>
		<link>http://burm.net/2008/10/06/a-few-great-plugins-that-i-am-using-in-my-current-ruby-on-rails-project/</link>
		<comments>http://burm.net/2008/10/06/a-few-great-plugins-that-i-am-using-in-my-current-ruby-on-rails-project/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 03:12:21 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Rails Plugins]]></category>
		<category><![CDATA[Rails Tutorials]]></category>

		<guid isPermaLink="false">http://burm.net/?p=113</guid>
		<description><![CDATA[I am currently working on an interesting project for a customer of mine.   Hopefully I&#8217;ll be able to share more of the details with you all when the project is near completion.  The project involves creating events, parsing and caching RSS feeds, generating RSS feeds, as well as Emailing and SMS&#8217;ing subscribers daily events.   I [...]]]></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%2F10%2F06%2Fa-few-great-plugins-that-i-am-using-in-my-current-ruby-on-rails-project%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2008%2F10%2F06%2Fa-few-great-plugins-that-i-am-using-in-my-current-ruby-on-rails-project%2F&amp;source=burmjohn&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I am currently working on an interesting project for a customer of mine.   Hopefully I&#8217;ll be able to share more of the details with you all when the project is near completion.  The project involves creating events, parsing and caching RSS feeds, generating RSS feeds, as well as Emailing and SMS&#8217;ing subscribers daily events.   I have been working on the project for the last 5 days, and I am about one third of the way through.</p>
<p>I wanted to share some great plugins for Ruby on Rails that I have come across, along with some tutorials. Check back for an updated post with more info.</p>
<h2>Plugins:</h2>
<p><strong>Restful Authentication </strong>- This widely-used plugin provides a foundation for securely managing user authentication &#8211; <a href="http://github.com/technoweenie/restful-authentication/tree/master">http://github.com/technoweenie/restful-authentication/tree/master</a></p>
<p><strong>acts_as_taggable_on_steroids</strong> &#8211; This plugin is based on acts_as_taggable by DHH but includes extrassuch as tests, smarter tag assignment, and tag cloud calculations.  &#8211; <a href="http://github.com/mattetti/acts_as_taggable_on_steroids/tree/master  ">http://github.com/mattetti/acts_as_taggable_on_steroids/tree/master</a></p>
<p><strong>Paperclip</strong> &#8211; Paperclip is intended as an easy file attachment library for ActiveRecord. The intent behind it was to keep setup as easy as possible and to treat files as much like other attributes as possible. <a href="http://github.com/thoughtbot/paperclip/tree/master">http://github.com/thoughtbot/paperclip/tree/master</a></p>
<p><strong>Paperclip Polymorph</strong> &#8211; This plugin allows users of the Paperclip plugin to easily share attached files between multiple models. <a href="http://locusfoc.us/2008/6/29/paperclip-polymorph">http://locusfoc.us/2008/6/29/paperclip-polymorph</a></p>
<p><strong>acts_as_textiled </strong>- This simple plugin allows you to forget about constantly rendering Textile in your application. Instead, you can rest easy knowing the Textile fields you want to display as HTML will always be displayed as HTML (unless you tell your code otherwise). <a href="http://github.com/defunkt/acts_as_textiled/tree/master">http://github.com/defunkt/acts_as_textiled/tree/master</a></p>
<p><strong>Will_paginate</strong> &#8211; Pagination is just limiting the number of records displayed. Why should you let it get in your way while developing, then? This plugin makes magic happen. <a href="http://github.com/mislav/will_paginate/tree/master">http://github.com/mislav/will_paginate/tree/master</a></p>
<h2>Tutorials / Guides:</h2>
<p>If you are new to Ruby on Rails be sure to check out the guides that are being worked on right now here: <a href="http://guides.rails.info/index.html">http://guides.rails.info/index.html</a></p>
<p><strong>Railscasts</strong> &#8211; Free Ruby on Rails Screencasts &#8211; <a href="http://railscasts.com/">http://railscasts.com/</a></p>
<p><strong>Learning Rails</strong> &#8211; Audio (Podcasts) and Screencasts -<a href="http://www.buildingwebapps.com/podcasts"> http://www.buildingwebapps.com/podcasts</a></p>
<p>Jim created a great list of plugins he found useful when he was building a social network in Rails. Check it out here: <a href="http://jimneath.org/2008/04/25/building-a-social-network-site-in-rails/">http://jimneath.org/2008/04/25/building-a-social-network-site-in-rails/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2008/10/06/a-few-great-plugins-that-i-am-using-in-my-current-ruby-on-rails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

