English 中文(简体)
主动行政管理 + 认证整合 - 铁路 3.2
原标题:Active Admin + Authlogic Integration - Rails 3.2

有谁知道如何将活跃的行政管理与对称管理整合( Im 使用 Authlogic_ldap_acondicaticable 宝石认证 AD )? 我知道活跃的行政管理使用Devise, 因此我应该对活跃的行政管理作什么修改, 让它与对称管理合作? 提前感谢 。

问题回答

注:我这样做时使用了铁路3.2.8和0.5.0。

其中一个方法就是:

  1. 首先,通过添加 gem activeadmin 更新 Gemfile, 并运行 铁路生成活动_ admin: attall 。 这些是活动管理 README 中的指示 。

  2. 通常已经有一个用户模式, 使用 Authlogic, 如果您打算使用这个模式, 请删除所有默认生成的新的 Admin 用户的所有文件 :

    • db/migrate/*_create_admin_users.rb (migration file)
    • app/models/admin_user.rb
    • spec/models/admin_user_spec.rb
  3. 删除具体设计文件 :

    • config/locales/devise.en.yml
    • config/initializers/devise.rb
  4. 删除配置/ routes.rb 中的“ 设计” 引用。

  5. s 生成的文件 app/admin/admin_user.rb 。 您可以将文件重新命名为 user.rb , 注册到 user , 而不是 AdminUser , 并删除Devise 专列上的索引。 或者, 您可以将文件完全删除, 并从头开始创建自己的文件 。

  6. 您的活动管理配置中更新以下内容( 参见 config/ regirtiizers/ active_ admin.rb ):

    • config.authentication_method
    • config.current_user_method
    • config.logout_link_path

    默认的 config.audetication_method :audeticate_admin_user 。 设置为您在要求管理员用户使用过滤方法之前所使用的方法, 例如 : require_admin 。 默认的 . poverty_ user_ ethod : p流_admin_user 。 使用“ user ” 的典型铁路应用程序可能为此有 : putrent_user 方法 。 并且 comfig.log_link_path 应该设置为您登出路径, 例如 :logout_path

你可能需要根据你的情况修改这些指示。





相关问题
Remove ActiveRecord in Rails 3

Now that Rails 3 beta is out, I thought I d have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...

When will you upgrade your app to Rails 3? [closed]

Now that the Rails 3 beta is here, let s take a little straw poll. Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you re not planning on upgrading ...

Bundler isn t loading gems

I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I ...

bypass attr_accessible/protected in rails

I have a model that, when it instantiates an object, also creates another object with the same user id. class Foo > ActiveRecord::Base after_create: create_bar private def create_bar Bar....

concat two fields activerecord

I m so used to oracle where you can simply concat(field1, , field2) but if I m using activerecord to find the field1 and field2, and I need a space in between, how do I accomplish this? Cheers ...

热门标签