A Gentle Introduction to CarrierWave

Let’s see this modularity first hand by building up a CarrierWave uploader from scratch.

To begin with, we’ll install CarrierWave:

  gem install carrierwave

Then, we can make the world’s shortest uploader:

  require 'carrierwave'

  class MyUploader < CarrierWave::Uploader::Base
    storage :file

Even at this point, we can start saving files:

  file = File.open('example.jpg')
  uploader = MyUploader.new

[snip -ed]

If you’re ready for more, check out:

I’m sure you’ll enjoy using CarrierWave as much as I have!

Source: Union Station


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s