Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I made attachment_fu rails3 compatible.</p> <p>See <a href="https://github.com/mihael/attachment_fu" rel="nofollow">https://github.com/mihael/attachment_fu</a></p> <p>EDIT: but it is broken for some users, and i am not maintaining it further, so please look into other solutions, if you do not want to hack it yourself ;)</p> <p>I tested paperclip vs carrierwave vs attachment_fu with rails3.0.3 for a project I am working on.</p> <p>So far <strong>attachment_fu</strong> works very well as always, but the code still needs some refactoring with the callback system. It has backends for cloudfiles, s3.</p> <p><strong>Paperclip</strong> is also very good and is very easy to use. The basic setup did not let me upload movies (had to add option :whiny=>false), and it did not sanitize filenames the way I expected. This is how I did it: </p> <pre><code>class Asset &lt; ActiveRecord::Base has_attached_file :file, :styles =&gt; { :small =&gt; "300x300&gt;", :thumb =&gt; "50x50&gt;" }, :whiny =&gt; false before_create :sanitize_file_name private def sanitize_file_name self.file.instance_write( :file_name, file_file_name.gsub(/[^A-Za-z0-9\.\-]/, '_')) end end </code></pre> <p>Paperclip has s3 backend, but does not have a backend for cloudfiles built-in. There is a paperclip fork for that (google for paperclip-cloudfiles) which is built for rails2.3.5 (search github for paperclip_demo). </p> <p><strong>Carrierwave</strong> looks very nice, with the decoupled architecture, but I do not like the fact that it does not delete stuff on updates and destroys of objects, leaving a bunch of files and directories on disk. The basic carrierwave setup also did not let me upload movies, although it sanitizes filenames nicely. I did not found a quick fix for this, yet. If You are using Mongoid and GridFS, carrierwave has built in support.</p> <p>Finally, I took Paperclip for my project.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload