Skip to content

Instantly share code, notes, and snippets.

@BenHall
Created October 25, 2009 10:13
Show Gist options
  • Save BenHall/217988 to your computer and use it in GitHub Desktop.
Save BenHall/217988 to your computer and use it in GitHub Desktop.
using mongomapper with ruby on rails
class HomeController < ApplicationController
def index()
post = Post.create({
:title => 'John'
})
post.save
@posts = Post.find(:all)
end
end
class Post
include MongoMapper::Document
connection XGen::Mongo::Driver::Connection.new('localhost')
database 'db'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment