摘要: 系统的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 阅读全文
posted @ 2013-11-07 12:13 wangyuyu 阅读(2449) 评论(0) 推荐(0) 编辑