Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 47 lines (27 sloc) 1.571 kB
ddff0ea @jstorimer Added README
jstorimer authored
1 h1. Delayed::Paperclip
2
3 *Warning: ATM this is alpha software and has not been tested in a production environment*
4
6c19ae4 @jstorimer License and readme formatting
jstorimer authored
5 Delayed_paperclip lets you process your "Paperclip":http://github.com/thoughtbot/paperclip attachments in a background task with "delayed_job":http://github.com/tobi/delayed_job.
ddff0ea @jstorimer Added README
jstorimer authored
6
7 h2. Why?
8
6712736 @jstorimer Removed processing attribute.
jstorimer authored
9 The most common use case for Paperclip is to easily attach image files to ActiveRecord models. Most of the time these image files will have multiple styles and will need to be resized when they are created. This is usually a pretty "slow operation":http://www.jstorimer.com/ruby/2010/01/05/speep-up-your-paperclip-tests.html and should be handled in a background task.
ddff0ea @jstorimer Added README
jstorimer authored
10
6712736 @jstorimer Removed processing attribute.
jstorimer authored
11 I'm sure that everyone knows this, this gem just makes it easy to do.
12
13 h2. Install
14
15 <code>sudo gem install delayed_paperclip</code>
16
17 Dependencies:
18 * Paperclip
19 * delayed_jobs
ddff0ea @jstorimer Added README
jstorimer authored
20
21 h2. Usage
22
23 Make sure that you have "DJ":http://github.com/tobi/delayed_job up and running.
24
25 In your model:
202e931 @jstorimer README formatting wtf
jstorimer authored
26
ddff0ea @jstorimer Added README
jstorimer authored
27 <pre><code>
28 class User < ActiveRecord::Base
29 has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
30
31 process_in_background :avatar
32 end
33 </code></pre>
34
35 Use your Paperclip attachment just like always in controllers and views.
36
37 h2. What if I'm not using images?
38
6712736 @jstorimer Removed processing attribute.
jstorimer authored
39 AFAIK this library should work no matter what kind of post-processing you are doing with Paperclip.
ddff0ea @jstorimer Added README
jstorimer authored
40
41 h2. Does it work with s3?
42
43 Yes.
44
6c19ae4 @jstorimer License and readme formatting
jstorimer authored
45 h2. Inspirations
46
47 "http://blog.madeofcode.com/post/201282903/paperclip-s3-delayed-job-in-rails":http://blog.madeofcode.com/post/201282903/paperclip-s3-delayed-job-in-rails
Something went wrong with that request. Please try again.