摘要:
系统的model关系如下:用户类class AdminUser embeds_many :permissions accepts_nested_attributes_for :permissions, :allow_destroy => trueend用户能力类class Ability include CanCan::Ability def initialize(user) can do |action, subject_class, subject| end权限类class Permission include Mongoid::Document embedded_in :admin 阅读全文