How to Use Rails Generators with MongoDB
The MongoDB classes do not come with default generators for Rails applications. In order to use the rails generate commands, you can use the indirect rails3-generators project available at https://github.com/indirect/rails3-generators/#readme
Installation:
- Download the generators into your application’s lib folder:
cd myapp git clone git://github.com/indirect/rails3-generators.git lib/generators`
- Install the rails3-generators gem
gem install rails3-generators
- Add this to your project’s Gemfile
gem 'rails3-generators'
Usage:
rails generate model ModelName --orm=mongo_mapper