Giter Site home page Giter Site logo

mongoid-carrierwave-uploadify's Introduction

Rails 3, Mongoid, Carrierwave, Uploadify, and Devise

This is a demonstration application using:

  • Ruby 1.9.2 — Best programming language
  • 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
  • Devise – Rack based authentication

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.

NOTE: There is a Rack middleware located in lib/include that needs to be inserted into the Rails session chain. Take note of adding the directory that contains the middleware to your application.rb’s autoload_paths. Also, look in config/initializers/session_store.rb to see how to insert the FlashSessionCookieMiddleware.

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.

Devise

http://github.com/plataformatec/devise

Authentication system using Warden rack middleware. Integrates with Mongoid. Base project has authentication disabled. To enable authentication, uncomment “before_filter :authenticate_user!” in application_controller.rb

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

mongoid-carrierwave-uploadify's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.