Skip to content

Commit e6a694c

Browse files
committed
Improve install guide
1 parent 410aae8 commit e6a694c

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ For more on Mongoid support in ActiveAdmin see [this issue](https://github.com/g
1010

1111
## Installation
1212

13-
Add this line to your application's Gemfile:
13+
### Some Gems
14+
Add the following gems to your application's Gemfile:
1415

1516
```ruby
1617
gem 'activeadmin-mongoid'
18+
gem 'devise'
1719
```
20+
Devise is the gem used to managed admin authentication.
21+
The gem is required to force itself ORM configuration.
22+
Else the gem will try to use by default ActiveRecord ORM.
1823

1924
You can safely remove the following lines, since are already activeadmin-mongoid dependencies:
2025

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

27-
And then execute:
32+
### Remove Application Dependencies
33+
In your config/application.rb, replace :
34+
35+
```ruby
36+
require 'rails/all'
37+
```
38+
39+
with :
40+
41+
```ruby
42+
require "action_controller/railtie"
43+
require "action_mailer/railtie"
44+
require "active_resource/railtie"
45+
require "sprockets/railtie"
46+
require "rails/test_unit/railtie"
47+
```
48+
49+
rails/all includes elements requiring ActiveRecord::Connection ...
50+
51+
### Bundle & Crank
52+
53+
Execute:
2854

2955
$ bundle
56+
$ rails g devise:install
57+
58+
Check that the generated initializers/devise.rb file requires mongoid orm.
59+
You may find a line like this :
60+
61+
```ruby
62+
require 'devise/orm/mongoid'
63+
```
3064

65+
And that's pretty much it !
3166

3267
## Contributing
3368

0 commit comments

Comments
 (0)