ActiveAdmin hacks to support Mongoid. Some ActiveAdmin features are disabled:
For more on Mongoid support in ActiveAdmin see this issue.
Add the following gems to your application's Gemfile:
gem 'activeadmin-mongoid' gem 'devise'
Devise is the gem used to managed admin authentication. The gem is required to force itself ORM configuration. Else the gem will try to use by default ActiveRecord ORM.
You can safely remove the following lines, since are already activeadmin-mongoid dependencies:
gem 'activeadmin' gem 'meta_search', '>= 1.1.0.pre' gem 'sass-rails', ['~> 3.1', '>= 3.1.4']
Remove Application Dependencies
In your config/application.rb, replace :
require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" require "sprockets/railtie" require "rails/test_unit/railtie"
rails/all includes elements requiring ActiveRecord::Connection ...
Bundle & Crank
$ bundle $ rails g devise:install
Check that the generated initializers/devise.rb file requires mongoid orm. You may find a line like this :
Then create the admin user:
$ rails console >> AdminUser.create :email => 'email@example.com', :password => 'password', :password_confirmation => 'password'
And that's pretty much it !
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Copyright © 2012 Elia Schito. See LICENSE for details.