PX-Cloudy / mongodb

Test app using Ruby 1.9.2 + Rails 3.0.4 + MongoDB + MongoID + HAML + jQuery + I18n + CarrierWave + Fog + Delayed Job

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test Application

This app was created to test Ruby 1.9.2, Rails 3.0.4 and some of the newest releases of most useful gems.

NOTE : Even though I have tried to make this document as clear and user friendly as possible, it is needed some previous knowledge about Ruby, Rails and its gems. TMP NOTE : I am still working on this README file in order to cover all the details related to the test.

Used Tools

  • Ruby 1.9.2 + Rails 3.0.4

  • MongoDB as database and MongoID as mapper

  • BSON + bson_ext to accelerate the Ruby BSON serialization, used by MongoDB as the data storage and network transfer format for “documents”

  • HAML as the template engine, with some translations in English and Spanish using I18n

  • jQuery + jquery-ujs ( jQuery.rails.js ) instead of Prototype to handle the AJAX requests and stuff

  • jQuery Cascade is a plugin for “jquery” used to handle dependencies between several drop down lists

  • jQuery Lightbox a quite simple plugin to display nicely the uploaded images

  • CarrierWave + Fog to process and upload files to the Amazon S3 server

  • MiniMagick as the image processing library used by “CarrierWave” to process the uploaded images

  • ImageMagick is used by “MiniMagick” to process the images.

  • Delayed Job + delayed_job_mongoid to run the upload of files asynchronously in the background

Getting Started

Download and install Ruby 1.9.2, the MongoDB 1.6.5 and install the latest version for the needed gems using the bundle command ( please refer to the “Gemfile” for more details about the used gems ) :

[sudo] bundle install

NOTE : Windows users will need to install DevKit in order to be able to install some gems ( like BSON ), and also need to avoid paths with spaces for the above installations ( believe me, this will save you headaches ).

In order to create the indexes needed by “delayed_job” lets run :

script/rails runner 'Delayed::Backend::Mongoid::Job.create_indexes'

NOTE : Please refer to the “delayed_job_mongoid” page for more information about the above command.

Do not forget to modify the “config/initializers/carrierwave.rb” file with your own “s3_access_key_id”, “s3_secret_access_key”, and “s3_bucket” in order to give access to “CarrierWave” to the Amazon S3 server, and the “config/mongoid.yml” file to fit your database settings.

NOTE : Refer to the “Gemfile”, the “config/application.rb” and the “config/routes.rb” files and the “config/locales” folder for extra configurations.

Quick Start

Lets load some feeds into our database in order to have some data to play with the dependent drop down lists. So lets run :

rake db:seed

Useful Documentation

Useful Railcasts

Getting Help

  • Please feel free to contact me for any issue or doubt, but please remember that this is just a test and not a full production app, so wait issues.

Thanks to

  • Trevor Turk who helped me to solve an issue storing several versions with “CarrierWave” on the “Amazon S3” server on a “Windows” machine ( Issue 220 )

About

Test app using Ruby 1.9.2 + Rails 3.0.4 + MongoDB + MongoID + HAML + jQuery + I18n + CarrierWave + Fog + Delayed Job


Languages

Language:Ruby 52.0%Language:JavaScript 27.7%Language:HTML 15.2%Language:CSS 5.0%