app/uploaders/file_uploader.rb
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
Override the directory where uploaded files will be stored.
This is a sensible default for uploaders that are meant to be mounted.
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
    case Rails.env
      when 'production'
        Rails.root.join('..', '..', 'shared', 'uploads', "#{model.user_id}", "#{model.created_at.year}", "#{model.created_at.month}", "#{model.created_at.day}", "#{model.id}").to_s
      when 'development', 'test'
        Rails.root.join('uploads', "#{model.user_id}", "#{model.created_at.year}", "#{model.created_at.month}", "#{model.created_at.day}", "#{model.id}").to_s
    end
  end
def store_dir case Rails . env when 'production' Rails . root . join ( '..' , '..' , 'shared' , 'uploads' , "#{model.user_id}" , "#{model.created_at.year}" , "#{model.created_at.month}" , "#{model.created_at.day}" , "#{model.id}" ) . to_s when 'development' , 'test' Rails . root . join ( 'uploads' , "#{model.user_id}" , "#{model.created_at.year}" , "#{model.created_at.month}" , "#{model.created_at.day}" , "#{model.id}" ) . to_s end end
Override the directory where uploaded files will be stored.
Override the directory where uploaded files will be stored .
#"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"