Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ For more on Mongoid support in ActiveAdmin see [this issue](https://github.com/g

## Installation

Add this line to your application's Gemfile:
### Some Gems
Add the following gems to your application's Gemfile:

```ruby
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:

Expand All @@ -24,10 +29,40 @@ gem 'meta_search', '>= 1.1.0.pre'
gem 'sass-rails', ['~> 3.1', '>= 3.1.4']
```

And then execute:
### Remove Application Dependencies
In your config/application.rb, replace :

```ruby
require 'rails/all'
```

with :

```ruby
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should leave a commented # require "activerecord/railtie" here as does rails when you do rails new -O

(but I'll merge anyway :)

```

rails/all includes elements requiring ActiveRecord::Connection ...

### Bundle & Crank

Execute:

$ bundle
$ rails g devise:install

Check that the generated initializers/devise.rb file requires mongoid orm.
You may find a line like this :

```ruby
require 'devise/orm/mongoid'
```

And that's pretty much it !

## Contributing

Expand Down