Rails sample app for using minio with paperclip
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
docs
lib
log
public
test
vendor/assets
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

RoR Resume app using paperclip and minio Gitter

minio_ROR

Example Ruby on Rails App that works with a Minio Server. We will use the paperclip in our rails app to upload objects to a Minio Server. Full code is available here : https://github.com/sadysnaat/minio-paperclip, released under Apache 2.0 License.

1. Prerequisites

2. Dependencies

3. Install

$ git clone git@github.com:sadysnaat/minio-paperclip.git
$ cd minio-paperclip
$ bundle install

4. Set Up Bucket

In this example I have used minio public server and bucket is testbucket.

If you wish to use another bucket, create a new bucket with the following command.

$ mc mb play/new_bucket_name

5. Configure paperclip defaults to Minio Server

# Set default configuration here, if you wish to use different buckets/servers in
# different environments please set configuration in config/environments/ files
# For more details please refer to
# https://github.com/thoughtbot/paperclip#defaults
config.paperclip_defaults = {
  storage: :s3,
  s3_protocol: ':https',
  s3_permissions: 'private',
  s3_region: 'us-east-1',
  s3_credentials: {
    bucket: 'testbucket',
    access_key_id: 'Q3AM3UQ867SPQQA43P2F',
    secret_access_key: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
  },
  s3_host_name: 'play.minio.io:9000',
  s3_options: {
    endpoint: "https://play.minio.io:9000", # for aws-sdk
    force_path_style: true # for aws-sdk (required for minio)
  },
  url: ':s3_path_url',
  path: "/:class/:id.:style.:extension"
}

8. Run The App

$ rake db:migrate
$ rails s

Now if you visit http://localhost:3000 you should be able to see the example application.