2
进出口使用惨惨load_and_authorize_resource
helper方法用于获取资源和产生的授权,但我有这样惨惨宝石与嵌套的资源和:find_by
load_and_authorize_resource :company
load_and_authorize_resource :accountings, :through => :company, :class => 'Departments::Accounting'
一个嵌套的资源,但我需要 @accountings通过其他属性找到而该Departmets ::会计ID,并给一个值,属性,例如
@accountings = @company.find_by_period_id(@period.id)