【问题标题】:cancan and inherited_resources overwriting collectioncancan 和inherited_resources 覆盖集合
【发布时间】:2011-02-10 21:51:38
【问题描述】:

我想我正在与我最喜欢的两个宝石发生冲突。考虑以下几点:

class AccountsController < InheritedResources::Base
  load_and_authorize_resource

  def collection
    @accounts ||= end_of_association_chain.order_by(:name.asc).paginate(:page => params[:page],:per_page =>10)
  end

end

CanCan 似乎没有调用 collection 方法。我觉得应该。

是否有已知的解决方法?我在做傻事吗?

谢谢!

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 cancan inherited-resources


    【解决方案1】:

    似乎经过长时间的讨论——这将不被支持。查看此线程的推理和解决方法:https://github.com/ryanb/cancan/issues/274#comment_888081

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-11
      • 1970-01-01
      相关资源
      最近更新 更多