Commit 8870603e by Hoang Phuc Do

Image handling by carrierwave instead of using paperclip

parent 0531803a
......@@ -30,8 +30,10 @@ gem 'jbuilder', '~> 2.5'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Paperclip is intended as an easy file attachment library for ActiveRecord
gem "paperclip", "~> 5.0.0"
# Provides a simple and extremely flexible way to upload files from Ruby applications
gem 'carrierwave', '~> 1.0'
# A ruby wrapper for ImageMagick or GraphicsMagick command line.
gem 'mini_magick'
# bootstrap-sass is a Sass-powered version of Bootstrap 3
gem 'bootstrap-sass', '~> 3.3.6'
# Vacuum is a fast, light-weight Ruby wrapper to the Amazon Product Advertising API
......
......@@ -56,11 +56,12 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
carrierwave (1.1.0)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
childprocess (0.7.0)
ffi (~> 1.0, >= 1.0.11)
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
......@@ -93,7 +94,7 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_magick (4.5.1)
mini_portile2 (2.2.0)
minitest (5.10.2)
multi_json (1.12.1)
......@@ -102,12 +103,6 @@ GEM
nio4r (2.1.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
paperclip (5.0.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (~> 0.3.0)
public_suffix (2.0.5)
puma (3.9.1)
rack (2.0.3)
......@@ -197,11 +192,12 @@ DEPENDENCIES
bootstrap-sass (~> 3.3.6)
byebug
capybara (~> 2.13)
carrierwave (~> 1.0)
coffee-rails (~> 4.2)
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
mini_magick
mysql2 (>= 0.3.18, < 0.5)
paperclip (~> 5.0.0)
puma (~> 3.7)
rails (~> 5.1.1)
sass-rails (~> 5.0)
......
class AddImageColumnsToProducts < ActiveRecord::Migration[5.1]
def up
add_attachment :products, :image
end
def down
remove_attachment :products, :image
def change
add_column :products, :image_url, :string
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment