<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Ruby On Rails Polymorphic Paperclip Plugin Tutorial</title>
	<atom:link href="http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/</link>
	<description>John Burmeister's Blog</description>
	<lastBuildDate>Fri, 14 May 2010 17:16:28 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mihai</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-34903</link>
		<dc:creator>Mihai</dc:creator>
		<pubDate>Fri, 14 May 2010 17:16:28 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-34903</guid>
		<description>adam, found the solution to your problem?</description>
		<content:encoded><![CDATA[<p>adam, found the solution to your problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rtacconi</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-33100</link>
		<dc:creator>rtacconi</dc:creator>
		<pubDate>Sun, 24 Jan 2010 00:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-33100</guid>
		<description>I am not able to save any file. I always get object.assets.size = 0</description>
		<content:encoded><![CDATA[<p>I am not able to save any file. I always get object.assets.size = 0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jayme</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-32156</link>
		<dc:creator>Jayme</dc:creator>
		<pubDate>Fri, 20 Nov 2009 01:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-32156</guid>
		<description>Where can I change the accepted content file type?</description>
		<content:encoded><![CDATA[<p>Where can I change the accepted content file type?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-32099</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Fri, 13 Nov 2009 06:08:07 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-32099</guid>
		<description>sorry...that should&#039;ve been:

&lt;% @project.assets.each do &#124;asset&#124; %&gt;

    &lt;%= image_tag asset.url(:thumb) %&gt;&lt;br /&gt;
    &lt;%= link_to &quot;delete&quot;, asset.detach(asset) %&gt;

&lt;% end %&gt;</description>
		<content:encoded><![CDATA[<p>sorry&#8230;that should&#8217;ve been:</p>
<p>&lt;% @project.assets.each do |asset| %&gt;</p>
<p>    &lt;%= image_tag asset.url(:thumb) %&gt;&lt;br /&gt;<br />
    &lt;%= link_to &#8220;delete&#8221;, asset.detach(asset) %&gt;</p>
<p>&lt;% end %&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-32098</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Fri, 13 Nov 2009 06:06:22 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-32098</guid>
		<description>I cannot get 

&lt;code&gt;


    
    


&lt;/code&gt;

to work.  I get &quot;ActiveRecord::RecordNotFound&quot; when i try to view the page with that code in it.</description>
		<content:encoded><![CDATA[<p>I cannot get </p>
<p><code></p>
<p></code></p>
<p>to work.  I get &#8220;ActiveRecord::RecordNotFound&#8221; when i try to view the page with that code in it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antoine</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-31995</link>
		<dc:creator>Antoine</dc:creator>
		<pubDate>Thu, 05 Nov 2009 02:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-31995</guid>
		<description>I&#039;m using polymorphic paperclip to have more than one type of attachment per model object. For instance a user can have an image and a pdf. I can upload both but i want to have to separate form fields for it and put different types of attachments in different folders. what is the best way to make implement that functionality with polymorphic paperclip?</description>
		<content:encoded><![CDATA[<p>I&#8217;m using polymorphic paperclip to have more than one type of attachment per model object. For instance a user can have an image and a pdf. I can upload both but i want to have to separate form fields for it and put different types of attachments in different folders. what is the best way to make implement that functionality with polymorphic paperclip?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristian Mandrup</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-31254</link>
		<dc:creator>Kristian Mandrup</dc:creator>
		<pubDate>Tue, 25 Aug 2009 12:59:22 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-31254</guid>
		<description>I thought the controller logic was missing, but it turns out it works by pure magic! ;)

You have to be careful, that if you add the polymorphic association to user, then :data must be added to attr_accessible in order to allow mass assignment (or add :data manually after mass assignment in the controller method - update/create!)

Something similar to this... not sure how exactly I must confess (anyone?)

def update
    @user.update_attributes(params[:user])    
    @user.data = params[:user[:data]])    
    ...
end</description>
		<content:encoded><![CDATA[<p>I thought the controller logic was missing, but it turns out it works by pure magic! <img src='http://burm.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>You have to be careful, that if you add the polymorphic association to user, then :data must be added to attr_accessible in order to allow mass assignment (or add :data manually after mass assignment in the controller method &#8211; update/create!)</p>
<p>Something similar to this&#8230; not sure how exactly I must confess (anyone?)</p>
<p>def update<br />
    @user.update_attributes(params[:user])<br />
    @user.data = params[:user[:data]])<br />
    &#8230;<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristian Mandrup</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-31250</link>
		<dc:creator>Kristian Mandrup</dc:creator>
		<pubDate>Tue, 25 Aug 2009 10:19:49 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-31250</guid>
		<description>How can I create a named scope to get the first asset referenced by a model? fx:

class User

  acts_as_polymorphic_paperclip  
  has_one :main_pic,
          :class_name =&gt; &#039;Asset&#039;

&gt;&gt; User.first.main_pic

Mysql::Error: Unknown column &#039;assets.user_id&#039; in &#039;where clause&#039;: SELECT * FROM `assets`     WHERE (`assets`.user_id = 1)  LIMIT 1

I guess I could create a method, but not as elegant or flexible (can&#039;t be nested with other scoped etc.)

def first_pic
  assets[0]
end

Any ideas?</description>
		<content:encoded><![CDATA[<p>How can I create a named scope to get the first asset referenced by a model? fx:</p>
<p>class User</p>
<p>  acts_as_polymorphic_paperclip<br />
  has_one :main_pic,<br />
          :class_name =&gt; &#8216;Asset&#8217;</p>
<p>&gt;&gt; User.first.main_pic</p>
<p>Mysql::Error: Unknown column &#8216;assets.user_id&#8217; in &#8216;where clause&#8217;: SELECT * FROM `assets`     WHERE (`assets`.user_id = 1)  LIMIT 1</p>
<p>I guess I could create a method, but not as elegant or flexible (can&#8217;t be nested with other scoped etc.)</p>
<p>def first_pic<br />
  assets[0]<br />
end</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Ludewig</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-29270</link>
		<dc:creator>Andreas Ludewig</dc:creator>
		<pubDate>Thu, 28 May 2009 16:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-29270</guid>
		<description>Oh, sorry I diddnt get the hole message submitted: I thought about @asset instead @document.</description>
		<content:encoded><![CDATA[<p>Oh, sorry I diddnt get the hole message submitted: I thought about @asset instead @document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Ludewig</title>
		<link>http://burm.net/2008/10/17/ruby-on-rails-polymorphic-paperclip-plugin-tutorial/comment-page-1/#comment-29269</link>
		<dc:creator>Andreas Ludewig</dc:creator>
		<pubDate>Thu, 28 May 2009 15:58:18 +0000</pubDate>
		<guid isPermaLink="false">http://burm.net/?p=138#comment-29269</guid>
		<description>Many thanks for this tutorial.
Some questions:
1)What is the structure of the join table and the join model? That could be interesting, too.

2)Shouldn´t it be 
 { :multipart =&gt; true }) do &#124;f&#124; %&gt;
in the form (instead @ document)??

3) I think there is the &quot;install&quot; command missing in the installing call.

Many Thanks so far.
Andreas</description>
		<content:encoded><![CDATA[<p>Many thanks for this tutorial.<br />
Some questions:<br />
1)What is the structure of the join table and the join model? That could be interesting, too.</p>
<p>2)Shouldn´t it be<br />
 { :multipart =&gt; true }) do |f| %&gt;<br />
in the form (instead @ document)??</p>
<p>3) I think there is the &#8220;install&#8221; command missing in the installing call.</p>
<p>Many Thanks so far.<br />
Andreas</p>
]]></content:encoded>
	</item>
</channel>
</rss>
