Skip to content

Instantly share code, notes, and snippets.

@alvinthen
Created November 22, 2016 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvinthen/227f843c7079ce946598586f662f9a2f to your computer and use it in GitHub Desktop.
Save alvinthen/227f843c7079ce946598586f662f9a2f to your computer and use it in GitHub Desktop.
Rails image upload using carrierwave and fog

Add gems

gem 'carrierwave',             '0.11.2'
gem 'mini_magick',             '4.5.1'
gem 'fog',                     '1.38.0'

Run rails g uploader Image

Add to existing model

rails g migration add_picture_to_models image:string

Mount in existing model

mount_uploader :picture, PictureUploader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment