This is a pic upload tool,use rails and qiniu
Switch branches/tags
Nothing to show
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
lib
public
test
tmp
vendor/assets
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru
secrets.config

README.md

Upload Pic With Rails and Qiniu

Version

V0.1.1 @ 20170108

Function

  1. Upload pic in your own Qiniu bucket
  2. u can copy pic URL or copy markdown Pic URL

Todo

  1. multi pic upload
  2. edit pic
  3. customize upload directory
  4. write a blog about this tool

Requirement

ruby version = 2.3.1
rails version = 5.0.1

Usage

  1. clone this code

  2. cp sercrets.config to /config/secrets.yml

  3. fill in your own qiniu_access_key and qiniu_secret_key

  4. local$: bundle install

    if qiniu and mime-types have some depends error
    local$: bundle update mime-types

  5. local$: rails db:create

  6. edit /app/controllers/pictures_controller.rb

    # line 30
    outurl = 'your own qiniu URL'
    ... ...
    # line 78
    bucket = "your own bucket name"
    ... ...
    # line 83(optional)
    put_policy.save_key = 'test/2017/${fname}'
  1. local$: rails db:migrate
  2. local$: rails s

Enjoy pic upload

中文版使用说明在 这里