<?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; My Projects</title>
	<atom:link href="http://burm.net/tag/my-projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://burm.net</link>
	<description>John Burmeister's Blog</description>
	<lastBuildDate>Thu, 06 May 2010 20:04:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stairs are now done, finally!</title>
		<link>http://burm.net/2009/11/16/stairs-are-now-done-finally/</link>
		<comments>http://burm.net/2009/11/16/stairs-are-now-done-finally/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 04:19:28 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[Levittown]]></category>
		<category><![CDATA[My Projects]]></category>
		<category><![CDATA[house]]></category>
		<category><![CDATA[long island]]></category>
		<category><![CDATA[painting]]></category>

		<guid isPermaLink="false">http://burm.net/?p=247</guid>
		<description><![CDATA[These stairs are finally done.  First was the endless sanding, then the staining and polyurethane.  I put off painting the risers and sides because its a nightmare to prep, plus I had other projects from &#8220;The List&#8221; to get done.  I went through a roll of tape just getting everything ready before painting.  Primed with [...]]]></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%2F16%2Fstairs-are-now-done-finally%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2009%2F11%2F16%2Fstairs-are-now-done-finally%2F" height="61" width="51" /></a></div><p>These stairs are finally done.  First was the endless sanding, then the staining and polyurethane.  I put off painting the risers and sides because its a nightmare to prep, plus I had other projects from &#8220;The List&#8221; to get done.  I went through a roll of tape just getting everything ready before painting.  Primed with a good primer, then hit it with a semi gloss white from Benjamin moore.  (I went with the semi gloss because of durability, I used this on all my moldings and doors)</p>
<p>Anyways, here are some pics.  The flash from the camera makes it seem more shiny then it actually is, I think it came out pretty good.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0063" href="http://burm.net/photos/photo/4108336912/img_0063.html"><img class="alignnone" src="http://farm3.static.flickr.com/2660/4108336912_2b33ea9ee3.jpg" alt="IMG_0063" width="375" height="500" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0066" href="http://burm.net/photos/photo/4108337118/img_0066.html"><img class="alignnone" src="http://farm3.static.flickr.com/2770/4108337118_e440a7b941.jpg" alt="IMG_0066" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0061" href="http://burm.net/photos/photo/4107570459/img_0061.html"><img class="alignnone" src="http://farm3.static.flickr.com/2507/4107570459_ce9bf36f17.jpg" alt="IMG_0061" width="375" height="500" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2009/11/16/stairs-are-now-done-finally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pics of new Fence, Front Door, and Entry Way&#8230;</title>
		<link>http://burm.net/2009/11/03/pics-of-new-fence-front-door-and-entry-way/</link>
		<comments>http://burm.net/2009/11/03/pics-of-new-fence-front-door-and-entry-way/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:03:10 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[house]]></category>
		<category><![CDATA[long island]]></category>
		<category><![CDATA[My Projects]]></category>

		<guid isPermaLink="false">http://burm.net/?p=244</guid>
		<description><![CDATA[Figured I&#8217;d update the old blog with a few house updates.  We had a new door put in, then me and my father-in-law tiled our entry way.  I also just had a fence put in.




Here is our poor attempt at a pumpkin carving  


]]></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%2F03%2Fpics-of-new-fence-front-door-and-entry-way%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2009%2F11%2F03%2Fpics-of-new-fence-front-door-and-entry-way%2F" height="61" width="51" /></a></div><p>Figured I&#8217;d update the old blog with a few house updates.  We had a new door put in, then me and my father-in-law tiled our entry way.  I also just had a fence put in.</p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0050" href="http://burm.net/photos/photo/4071556341/img_0050.html"><img class="alignnone" src="http://farm3.static.flickr.com/2442/4071556341_3e2833ea5b.jpg" alt="IMG_0050" width="375" height="500" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0041" href="http://burm.net/photos/photo/4072318034/img_0041.html"><img class="alignnone" src="http://farm3.static.flickr.com/2536/4072318034_59f9ffc984.jpg" alt="IMG_0041" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0038" href="http://burm.net/photos/photo/4072317258/img_0038.html"><img class="alignnone" src="http://farm3.static.flickr.com/2539/4072317258_10c11bd54c.jpg" alt="IMG_0038" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0037" href="http://burm.net/photos/photo/4071554633/img_0037.html"><img class="alignnone" src="http://farm3.static.flickr.com/2765/4071554633_3c31553f3a.jpg" alt="IMG_0037" width="500" height="375" /></a></p>
<p>Here is our poor attempt at a pumpkin carving <img src='http://burm.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0048" href="http://burm.net/photos/photo/4072318522/img_0048.html"><img class="alignnone" src="http://farm3.static.flickr.com/2511/4072318522_fba88ec309.jpg" alt="IMG_0048" width="500" height="375" /></a></p>
<p><a class="tt-flickr tt-flickr-Medium" title="IMG_0052" href="http://burm.net/photos/photo/4071556633/img_0052.html"><img class="alignnone" src="http://farm3.static.flickr.com/2539/4071556633_238f2e64b0.jpg" alt="IMG_0052" width="500" height="375" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2009/11/03/pics-of-new-fence-front-door-and-entry-way/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 [...]]]></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"><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" height="61" width="51" /></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>
		<item>
		<title>Ruby On Rails Polymorphic Paperclip Plugin Tutorial</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/</link>
		<comments>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 02:59:48 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://burm.net/?p=138</guid>
		<description><![CDATA[This tutorial is an extension of the paperclip tutorial I put up last week. This time we are going to take advantage of polymorphic paperclip.  Polymorphic paperclip utilizes separate tables (an assets table and an attachings table) to track your attachments.  This allows for an unlimited number of attachments per item per model. [...]]]></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%2F17%2Fruby-on-rails-polymorphic-paperclip-plugin-tutorial%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2008%2F10%2F17%2Fruby-on-rails-polymorphic-paperclip-plugin-tutorial%2F" height="61" width="51" /></a></div><p>This tutorial is an extension of the <a href="http://burm.net/2008/10/07/the-ruby-on-rails-paperclip-plugin-tutorial-easy-image-attachments/">paperclip tutorial</a> I put up last week. This time we are going to take advantage of polymorphic paperclip.  Polymorphic paperclip utilizes separate tables (an assets table and an attachings table) to track your attachments.  This allows for an unlimited number of attachments per item per model.  In the first tutorial I showed you how to attach just one item, although you could add more columns to your table to handle additional attachments this way is a lot more flexible.  While this plugin is not perfect, there is a lot of room for improvement, its a great starting point.  Perhaps a fork is on its way from me&#8230; </p>
<p>Project Page: <a href="http://github.com/heavysixer/paperclippolymorph/tree/master">http://github.com/heavysixer/paperclippolymorph/tree/master</a></p>
<p><strong>First things first, lets install the plugin:</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 git:<span style="color:#006600; font-weight:bold;">//</span>github.<span style="color:#9900CC;">com</span><span style="color:#006600; font-weight:bold;">/</span>heavysixer<span style="color:#006600; font-weight:bold;">/</span>paperclippolymorph.<span style="color:#9900CC;">git</span></pre></div></div>

<p>Lets setup our new migration that is needed.  After reading the rdoc, I noticed there was a new generator installed. Great, this makes things even easier.  Lets verify that the generator is available for use, first run:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>generate</pre></div></div>

<p>This should produce a list of all generators available for use, my list below might vary from yours depending upon what plugins you have installed&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Installed Generators
  Plugins (vendor/plugins): authenticated, forgot_password, open_id_authentication_tables, paperclip, polymorphic_paperclip, roles, rspec, rspec_controller, rspec_model, rspec_scaffold, upgrade_open_id_authentication_tables
  Builtin: controller, integration_test, mailer, migration, model, observer, plugin, resource, scaffold, session_migration</pre></div></div>

<p>As you will notice there is a polymorphic_paperclip generator, go ahead an run it as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>generate polymorphic_paperclip</pre></div></div>

<p>Before you go and run rake db:migrate, open up the migration and modify the assets_count to attachings_count &#8211; it seems there is a minor bug.  I notified the author of the plugin and will submit a patch via git.  Now its OK to run rake db:migrate</p>
<p>Now we have the migration generated and the tables have been added to your database. Next we have to add (or change if you already have paperclip setup) the model where you want to have attachments by adding  acts_as_polymorphic_paperclip.  As an example, I posted my documents model below.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Document <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
<span style="color:#008000; font-style:italic;"># Document Belongs To A User</span>
<span style="color:#5A0A0A; font-weight:bold;">belongs_to</span> <span style="color:#ff3333; font-weight:bold;">:user</span>
<span style="color:#008000; font-style:italic;"># for paperclip (polymorphic)</span>
acts_as_polymorphic_paperclip 
<span style="color:#008000; font-style:italic;"># Validations</span>
...</pre></div></div>

<p><strong>Note: </strong> Ideally I would like to be able to override the styles settings that are set in the plugins assets.rb, however I went ahead and hard coded them there to fit my needs. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Asset <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#5A0A0A; font-weight:bold;">has_many</span> <span style="color:#ff3333; font-weight:bold;">:attachings</span>, <span style="color:#ff3333; font-weight:bold;">:dependent</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:destroy</span>
  has_attached_file <span style="color:#ff3333; font-weight:bold;">:data</span>,
                    <span style="color:#ff3333; font-weight:bold;">:styles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
                    <span style="color:#ff3333; font-weight:bold;">:thumb</span><span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;100x100#&quot;</span>,
                    <span style="color:#ff3333; font-weight:bold;">:small</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;150x150&gt;&quot;</span>,
                    <span style="color:#ff3333; font-weight:bold;">:medium</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;300x300&gt;&quot;</span>,
                    <span style="color:#ff3333; font-weight:bold;">:large</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>   <span style="color:#996600;">&quot;500x500&gt;&quot;</span>,
                    <span style="color:#ff3333; font-weight:bold;">:xlarge</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>   <span style="color:#996600;">&quot;600x600&gt;&quot;</span>,
                    <span style="color:#ff3333; font-weight:bold;">:xxlarge</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>   <span style="color:#996600;">&quot;800x800&gt;&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>For now, lets move onto the views where you are going to allow attachments.  We are just going to have one upload, perhaps in another tutorial we will look at handling multiple uploads.  </p>
<p>You need to make sure you put the html => { :multipart => true } in both your edit and new views for the model you are working with. Example in my case:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#5A0A0A; font-weight:bold;">form_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>@document,:html <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:multipart</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span><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>f<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>= f.<span style="color:#9900CC;">error_messages</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;">render</span> <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'form'</span>, <span style="color:#ff3333; font-weight:bold;">:locals</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:f</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> f <span style="color:#006600; font-weight:bold;">&#125;</span> <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>Next you need to add the file upload field to your _form or edit/new views.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">&lt;p&gt;
  Attach a file or image &lt;br /&gt;
  <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#5A0A0A; font-weight:bold;">file_field</span> <span style="color:#ff3333; font-weight:bold;">:data</span><span style="color:#006600; font-weight:bold;">%&gt;</span>
&lt;/p&gt;</pre></div></div>

<p>Now lets go ahead and make these attachments viewable in the document.  For the edit view I added the following:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">&lt;p&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#5A0A0A; font-weight:bold;">image_tag</span> asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:medium</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/p&gt;
&lt;p&gt;Tiny:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:tiny</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;br /&gt;
 Small:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:small</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;br /&gt;
 Medium:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:medium</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;br /&gt;
 Large:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:large</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;br /&gt;
 XL:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:xlarge</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;br /&gt;
 XXL:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:xxlarge</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;br /&gt;   
 Original:  <span style="color:#006600; font-weight:bold;">&lt;%</span>= asset.<span style="color:#9900CC;">url</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
&lt;/p&gt;</pre></div></div>

<p><em><strong>Other Notes:</strong></em></p>
<p>You can use this to attach an attachment if you were going to use a different view, for example an upload view with @document.assets.attach(@asset)</p>
<p>You can nuke an attachment by either calling @document.assets.detach or @document.assets.detach(@asset) depending upon how you are going about dealing with removing attachments. @document.assets.detach  will nuke ALL attachments associated with that document, @document.essay.assets.detach(@asset) will nuke just that asset you are referencing. </p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/feed/</wfw:commentRss>
		<slash:comments>40</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[Ruby on Rails]]></category>
		<category><![CDATA[programming]]></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
Setup your migration [...]]]></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"><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" height="61" width="51" /></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:#6666ff; font-weight:bold;">ActiveRecord::Base</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:#ff3333; 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:#ff3333; 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>The Ruby On Rails Paperclip Plugin Tutorial &#8211; Easy Image Attachments</title>
		<link>http://burm.net/2008/10/07/the-ruby-on-rails-paperclip-plugin-tutorial-easy-image-attachments/</link>
		<comments>http://burm.net/2008/10/07/the-ruby-on-rails-paperclip-plugin-tutorial-easy-image-attachments/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 01:00:38 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[My Projects]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[RoR]]></category>

		<guid isPermaLink="false">http://burm.net/?p=127</guid>
		<description><![CDATA[I used Paperclip for my latest project, and I figured I would give a brief tutorial on how to use it.
Paperclip &#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 [...]]]></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%2F07%2Fthe-ruby-on-rails-paperclip-plugin-tutorial-easy-image-attachments%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2008%2F10%2F07%2Fthe-ruby-on-rails-paperclip-plugin-tutorial-easy-image-attachments%2F" height="61" width="51" /></a></div><p>I used Paperclip for my latest project, and I figured I would give a brief tutorial on how to use it.</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>In my case, I wanted to allow an attachment to an Event, which will have one photo.</p>
<p>To install:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>plugin install git:<span style="color:#006600; font-weight:bold;">//</span>github.<span style="color:#9900CC;">com</span><span style="color:#006600; font-weight:bold;">/</span>thoughtbot<span style="color:#006600; font-weight:bold;">/</span>paperclip.<span style="color:#9900CC;">git</span></pre></div></div>

<p>Create your migration, again in my case I was adding the images to my Events model / DB, so I did the following:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">script<span style="color:#006600; font-weight:bold;">/</span>generate migration AddPhotosToEvents</pre></div></div>

<p>Open up your newly created migration with your favorite Text editor, and add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> AddPhotoToEvent <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Migration</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">up</span>
    add_column <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:photo_file_name</span>, <span style="color:#ff3333; font-weight:bold;">:string</span>
    add_column <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:photo_content_type</span>, <span style="color:#ff3333; font-weight:bold;">:string</span>
    add_column <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:photo_file_size</span>, <span style="color:#ff3333; font-weight:bold;">:integer</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&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>
    remove_column <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:photo_file_name</span>
    remove_column <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:photo_content_type</span>
    remove_column <span style="color:#ff3333; font-weight:bold;">:events</span>, <span style="color:#ff3333; font-weight:bold;">:photo_file_size</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Then rake your migration so the new columns are added to your database:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">rake db:migrate</pre></div></div>

<p>Next you need to tell your model to use Paperclip, again I am using the Event model as an example, the #Paperclip and below is what you need to add.  If you notice below I added 4 options to the :styles.  I wanted to have a few different sizes generated when a image was uploaded, i named them appropriately (you can name them whatever you wish).   Please note when you put a # on the end it signifies that you want that <strong>exact</strong> aspect ratio, it will crop your photo automatically.  When you use > on the end it will make the largest side the size you specify and keep the aspect ratio uploaded.  In addition note that because we specified has_attached_file :photo its going to look for that naming convention we created in the migration above.  In addition it uses that name to store your photo in the public folder of your application.  So our photo url is going to be as follows: /public/photos/(event#)/(size_name)/image_name</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:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
<span style="color:#5A0A0A; font-weight:bold;">belongs_to</span> <span style="color:#ff3333; font-weight:bold;">:user</span>
<span style="color:#5A0A0A; font-weight:bold;">validates_presence_of</span> <span style="color:#ff3333; font-weight:bold;">:title</span>, <span style="color:#ff3333; font-weight:bold;">:on</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:create</span>, <span style="color:#ff3333; font-weight:bold;">:message</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;can't be blank&quot;</span>
<span style="color:#5A0A0A; font-weight:bold;">validates_presence_of</span> <span style="color:#ff3333; font-weight:bold;">:teaser</span>, <span style="color:#ff3333; font-weight:bold;">:on</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:create</span>, <span style="color:#ff3333; font-weight:bold;">:message</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;can't be blank&quot;</span>
<span style="color:#5A0A0A; font-weight:bold;">validates_presence_of</span> <span style="color:#ff3333; font-weight:bold;">:subject</span>, <span style="color:#ff3333; font-weight:bold;">:on</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:create</span>, <span style="color:#ff3333; font-weight:bold;">:message</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;can't be blank&quot;</span>
<span style="color:#008000; font-style:italic;"># Paperclip</span>
has_attached_file <span style="color:#ff3333; font-weight:bold;">:photo</span>,
  <span style="color:#ff3333; font-weight:bold;">:styles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#ff3333; font-weight:bold;">:thumb</span><span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;100x100#&quot;</span>,
    <span style="color:#ff3333; font-weight:bold;">:small</span>  <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;150x150&gt;&quot;</span>,
    <span style="color:#ff3333; font-weight:bold;">:medium</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;300x300&gt;&quot;</span>,
    <span style="color:#ff3333; font-weight:bold;">:large</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>   <span style="color:#996600;">&quot;400x400&gt;&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Next you need to make sure you put the html => { :multipart => true } in <strong>both </strong>your edit and new views for the model you are working with.  Example in my case:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#5A0A0A; font-weight:bold;">form_for</span><span style="color:#006600; font-weight:bold;">&#40;</span>@event,:html <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:multipart</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span><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>f<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>= f.<span style="color:#9900CC;">error_messages</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;">render</span> <span style="color:#ff3333; font-weight:bold;">:partial</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'form'</span>, <span style="color:#ff3333; font-weight:bold;">:locals</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:f</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> f <span style="color:#006600; font-weight:bold;">&#125;</span> <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>You then need to add the file_field to your new and edit forms or your _form partial like in my case:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;
  &lt;%= f.label 'Photo' %&gt;&lt;br /&gt;
  &lt;%= f.file_field :photo %&gt;
&lt;/p&gt;</pre></div></div>

<p>Next up is deciding on how you are going to use / view your images.   In my case I wanted to show a few different sizes in the Event view.  I also wanted to make sure I am only going to show photo&#8217;s if one exists. In this example I am just showing the small and medium sizes we generated:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;% if @event.photo.exists? then %&gt;
&lt;p&gt;Small:&lt;%= image_tag @event.photo.url(:small) %&gt;&lt;/p&gt;
&lt;p&gt;Medium:&lt;%= image_tag @event.photo.url(:medium) %&gt;&lt;/p&gt;
&lt;% else %&gt;
&lt;p&gt; There are no photo's attached, upload one. &lt;/p&gt;
&lt;% end %&gt;</pre></div></div>

<h3>A few other notes&#8230;</h3>
<p>
Calling @event.photo.nil destroys the photo</p>
<p>Also checkout this great tutorial <a href="http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/" target="_blank">Jim put up here.</a></p>
<p><a href="http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/" target="_blank"></a><br />
Thats all for now, I&#8217;ll try to post an update with some more options / features when using the Paperclip plugin in the future.</p>
<p>*** Checkout my other tutorial on <a href="http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/">polymorphic paperclip</a> if you would like to have multiple image attachments.</p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2008/10/07/the-ruby-on-rails-paperclip-plugin-tutorial-easy-image-attachments/feed/</wfw:commentRss>
		<slash:comments>16</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[Ruby on Rails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[programming]]></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"><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" height="61" width="51" /></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>
		<item>
		<title>EDITalk.com Launched with New Logo, blog and Forums</title>
		<link>http://burm.net/2008/10/06/editalk-launched-new-blog-logo-and-forums/</link>
		<comments>http://burm.net/2008/10/06/editalk-launched-new-blog-logo-and-forums/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 20:31:25 +0000</pubDate>
		<dc:creator>John Burmeister</dc:creator>
				<category><![CDATA[EDI]]></category>
		<category><![CDATA[My Projects]]></category>
		<category><![CDATA[editalk]]></category>
		<category><![CDATA[editalk.com]]></category>
		<category><![CDATA[Gentran Integration Suite]]></category>
		<category><![CDATA[GIS]]></category>

		<guid isPermaLink="false">http://burm.net/?p=82</guid>
		<description><![CDATA[EDITalk.com is one of my side projects, and I&#8217;d figure I&#8217;d post about it here on my blog.
The EDI Talk Blog and Forums have gone through some major changes in the last week.  We have invested in an amazing community software which includes forums / discussions, social groups, buddy lists, private messaging, user profiles, reputation [...]]]></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%2Feditalk-launched-new-blog-logo-and-forums%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fburm.net%2F2008%2F10%2F06%2Feditalk-launched-new-blog-logo-and-forums%2F" height="61" width="51" /></a></div><p>EDITalk.com is one of my side projects, and I&#8217;d figure I&#8217;d post about it here on my blog.</p>
<blockquote><p>The EDI Talk Blog and Forums have gone through some major changes in the last week.  We have invested in an amazing community software which includes forums / discussions, social groups, buddy lists, private messaging, user profiles, reputation system, and many other features.</p>
<p>I hope to see all of you join the community.  For those that would like to help, we are looking for qualified moderators to help make the site a better place for everyone.  We also have updated our blogging platform, and will be working to integrate it further with our discussion groups this week.  If you have an idea for a blog article or wish to write one yourself please let us know in the Article Idea&#8217;s category here: <a href="http://editalk.com/forums/forumdisplay.php?f=23" target="_blank">http://EDITalk.com/forums/forumdisplay.php?f=23</a></p>
<p>We are hoping to grow this community to make it an amazing free resource for everyone in the EDI world. If you have any suggestions, would like to get involved, or have any questions at all please let us know in the feedback forum here: <a href="http://editalk.com/forums/forumdisplay.php?f=24" target="_blank">http://EDITalk.com/forums/forumdisplay.php?f=24</a></p>
<p>To register (it only takes a few seconds) please visit the discussion forums here: <a href="http://editalk.com/forums/" target="_blank">http://EDITalk.com/forums/</a></p>
<p>In roughly one week we are planning on launching the EDI Wiki, which will be a community driven wiki that will cover all aspects of EDI and EDI related documents.</p>
<p>For the GIS (Gentran Integration Suite) users we have added a dedicated subsection just for you: <a href="http://editalk.com/forums/forumdisplay.php?f=39" target="_blank">http://editalk.com/forums/forumdisplay.php?f=39</a></p>
<p>And of course checkout the latest blog posts on the EDI blog: <a href="http://editalk.com/" target="_blank">http://EDITalk.com</a></p>
<p>See you on the forums. And if you have an RSS reader please be sure to add the EDITalk.com RSS feed to get the latest articles.  RSS Feed: <a href="http://editalk.com/feed" target="_blank">http://editalk.com/feed</a></p></blockquote>
<p>Pics: 
<a href='http://burm.net/2008/10/06/editalk-launched-new-blog-logo-and-forums/editalk_blog/' title='editalk_blog'><img width="150" height="150" src="http://burm.net/wp-content/uploads/2008/10/editalk_blog-150x150.png" class="attachment-thumbnail" alt="" title="editalk_blog" /></a>
<a href='http://burm.net/2008/10/06/editalk-launched-new-blog-logo-and-forums/editalk_forum/' title='editalk_forum'><img width="150" height="150" src="http://burm.net/wp-content/uploads/2008/10/editalk_forum-150x150.png" class="attachment-thumbnail" alt="" title="editalk_forum" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://burm.net/2008/10/06/editalk-launched-new-blog-logo-and-forums/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
