Skip to content

Rails 3.0, Mongoid ORM, Carrierwave Uploader, and Uploadify demonstration app.

Notifications You must be signed in to change notification settings

travelpost/mongoid-carrierwave-uploadify

Repository files navigation

Rails 3, Mongoid, Carrierwave, and Uploadify

This is a demonstration application using:

  • Rails 3.0 — Best web framework ever
  • Mongoid — A MongoDB mapper for Rails
  • Carrierwave — Upload and attach files to Rails models
  • Uploadify — Flash based multi-file uploader

Other depedencies:

  • RSpec 2.0 — Works well with Mongoid
  • JQuery 1.4.1 — Prototype replacement, required by Uploadify
  • jQuery-UI 1.8.4 — Used for drag and drop sorting of photos
  • HAML — Much better than writing in ERB
  • RemarkableMongoid — Very useful in testing standard Mongoid associations

Bonus:

  • Configuration to use Amazon S3

Uploadify

http://www.uploadify.com/

JQuery plugin that uses SWFObject to easily select and upload multiple files. Sensible defaults, good looking default buttons, excellent callback mechanism.

This project adds rack middleware to correctly pass session data into Rails as well as properly handle Javascript calls using respond_to. It also uses RJS to dynamically update the browser as each image is uploaded and a thumbnail is created.

Carrierwave

http://github.com/jnicklas/carrierwave

Uploading mechanism using Rack Middleware to handle accept uploads and “mount” them to the model. Carrierwave is best at isolating all uploading functions from the model it’s being attached to. Image is the mount point inside the photo model. The photo model is an embedded document inside the story model.

Mongoid

http://mongoid.org/

Mongoid is an excellent (and we think the best) ORM for MongoDB. It enables embedded documents as well as ActiveRecord style associations (called references). The documentation is good and is actively developed. It does not interfere with ActiveRecord so projects can use both in parallel.

jQuery

The jQuery UJS project for Rails lists 1.4.1 as the recommended version for Rails 3.0.

Amazon S3

App includes configuration to use S3 for production, :file for development, and :file without processing in test mode. See config/initializers/carrierwave.rb for details.

More

  • Stores photo width and height
  • Stores photo orientation
  • Live photo sorting using jQuery sortable

About

Rails 3.0, Mongoid ORM, Carrierwave Uploader, and Uploadify demonstration app.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published