Skip to content

aptos/BackboneMongoFullCalendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BackboneMongoFullCalendar

backbone.js with mongodb and fullCalendar.js on rails 3.1

Sample code for http://blog.shinetech.com/2011/08/05/building-a-shared-calendar-with-backbone-js-and-fullcalendar-a-step-by-step-tutorial

This sample has be modified to use Mongodb with mongoid:

  • Update Gemfile - note that newer versions of mongo gems didn't work for me

  • Update config/application.rb

      #require 'rails/all'

      # Use Mongodb
      require "action_controller/railtie"
      require "action_mailer/railtie"
      require "active_resource/railtie"
      require "sprockets/railtie"
  • create config/mongoid.yml - rails g mongoid:config

  • Add include Mongoid::Document to each model class

  • create initializers/mongoid.rb which modifies as_json to return an 'id' and '_id':

    module Mongoid
      module Document
        def as_json(options={})
          attrs = super(options)
          attrs["id"] = attrs["_id"]
          attrs
        end
      end
    end
  • After installing mongodb, gem install futon4mongo to check out the database

About

backbone.js with mongodb and fullCalendar.js on rails 3.1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published