CarrierWave makes it easy and clean to add file uploads to your application. It supports a variety of ORMs, frameworks and image processors.
This is a Rails 4 and Mongoid variant of the original railscast episode #253
Orignial RailsCast: http://railscasts.com/episodes/253-carrierwave-file-uploads