add bootstrap file input and menu item img implemented

This commit is contained in:
Yan
2017-08-15 16:27:40 +06:30
parent 3bfc7f0f53
commit e69eeadb6e
13 changed files with 111 additions and 22 deletions

View File

@@ -8,13 +8,21 @@ class MenuItemImageUploader < CarrierWave::Uploader::Base
storage :file
# storage :fog
def root
Rails.root.join 'public/'
end
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"public/image/menu_images"
"image/menu_images"
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# def cache_dir
# '/tmp/images'
# end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url(*args)
# # For Rails 3.1+ asset pipeline compatibility: