ActiveAdmin 修改以支持 Mongoid
ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin application. This repo was pulled into the ActiveAdmin org from previous work done by Elia Schito, and will be maintained by Grzegorz Jakubiak, Nic Boie, JD Guzman, Elia Schito and other ActiveAdmin and community members.
ransack-mongoid - it needs to be explicitly declared in Gemfile, pointing to github's master since it has no releases on rubygems yet.This gem has been brought into the ActiveAdmin org for support and maintenance.
ActiveAdmin hacks to support Mongoid. Some ActiveAdmin features are disabled or not working properly:
For more on Mongoid support in ActiveAdmin see this issue.
Add the following gems to your application's Gemfile, and lock the version:
gem 'activeadmin-mongoid', '1.0.0'
gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid'You can safely remove the following lines, since are already activeadmin-mongoid dependencies:
gem 'activeadmin'In your config/application.rb, replace:
require 'rails/all'with:
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"NOTE: This gem will NOT work if you use both ActiveRecord AND Mongoid in the same app. rails/all includes elements requiring ActiveRecord::Connection
Execute:
$ bundle
$ rails g devise:install
$ rails g active_admin:installCheck that the generated initializers/devise.rb file requires mongoid orm. You may find a line like this :
require 'devise/orm/mongoid'Then create an admin user:
$ bundle exec rails console
>> AdminUser.create email: '[email protected]', password: 'password', password_confirmation: 'password'And that's pretty much it !
git checkout -b my-new-feature)git commit -am 'Added some feature')git push origin my-new-feature)Copyright © 2012 Elia Schito. See LICENSE for details.
暂无开放 Issues,或尚未同步最近议题。