resource.rb
has_attached_file :image , :default_url => "/assets/member.png",
:storage => :s3,
:bucket => ENV['AMAZON_BUCKET_NAME'],
:s3_credentials => {
:access_key_id => ENV['AMAZON_API_KEY'],
:secret_access_key => ENV['AMAZON_API_SECRET']
},
:s3_protocol => "https",
:styles => {
:big => "498X300>",
:profile => "498X300>",
:large => "300x300>",
:thumb => "148x121>",
:gallery => "130x112>",
:medium => "70X72>",
:tiny => "67X55>",
:small =>"21X21>"
}
validates_format_of :image_file_name, :with => %r{\.(png|gif|jpg|jpeg|bmp)$}i
validates_attachment_content_type :image, :content_type => ['image/gif','image/jpeg','image/png','image/bmp'] ,:message => 'must be gif,jpeg,png,bmp'
validates_attachment_size :image, :less_than => 10.megabytes
process_in_background :image, :only_process => [:profile,:large,:thumb,:gallery,:medium,:small,:tiny]
gem 'delayed_paperclip'
gem 'sidekiq', '3.0.0'