Sha256: a062bd9e72b65268bb5772939c1d8583e01d7f192912681ba0c08a68f5bb2e3d

Contents?: true

Size: 694 Bytes

Versions: 6

Compression:

Stored size: 694 Bytes

Contents

module Uploaders
  class Avatar < CarrierWave::Uploader::Base
    include CarrierWave::MiniMagick
    # include CarrierWave::MiniMagick

    # Choose what kind of storage to use for this uploader:
    storage :file
    # storage :fog

    # 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
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end

    # Provide a default URL as a default if there hasn't been a file uploaded:

    # Create different versions of your uploaded files:
    version :thumb do
      process :resize_to_fit => [50, 50]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grape-gen-0.0.6 template/uploaders/avatar_uploader.rb
grape-gen-0.0.5 template/uploaders/avatar_uploader.rb
grape-gen-0.0.4 template/uploaders/avatar_uploader.rb
grape-gen-0.0.3 template/uploaders/avatar_uploader.rb
grape-gen-0.0.2 template/uploaders/avatar_uploader.rb
grape-gen-0.0.1 template/uploaders/avatar_uploader.rb