herokuamazon-s3ruby-on-rails-4.1comfortable-mexican-sofa

Upload comfortable mexican sofa cms image's to heroku from s3 bucket


I had successfully integrated comfortable mexican sofa CMS into an existing rails 4.1.2 application.

Now I want to upload images to heroku from s3 bucket.

Can anyone please tell the steps for that?


Solution

  • config.upload_file_options = {
      :whiny => false,
      :storage => :s3,
      :s3_credentials => {"access_key_id" => ENV["S3_ACCESS_KEY_ID"], "secret_access_key" => ENV["S3_SECRET_ACCESS_KEY"]},
      :bucket => ENV["S3_BUCKET_NAME"], 
      :s3_host_name => 's3 HOST NAME',
      :path => "uploaded_files/:basename.:extension",
      :styles => {:thumb => "850x850>" }
      }
    

    Give styles inside the config.upload_file_options which will take exact size of an image.

    Which make more sense in uploading image else image pixels may vary.

    The available configuration parameters are defined in paperclip, not comfy, and more information about there meaning can be found at:

    http://www.rubydoc.info/github/thoughtbot/paperclip/Paperclip/Storage/S3