cancan 和herited_resources 覆盖集合
我想我与我最喜欢的两颗宝石发生了冲突。请考虑以下事项:
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 似乎没有调用集合 方法。我觉得应该是这样。
有已知的解决方法吗?我是在做傻事吗?
谢谢!
I think I am running into a conflict with two of my favorite gems. Consider the following:
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
It does not seem the CanCan calls the collection method. I feel that it should.
Is there a known work around? Am I doing something silly?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过长时间的讨论,这似乎不会得到支持。查看此线程以进行推理和解决方法:https://github.com/ryanb/cancan /issues/274#comment_888081
It seems after lengthy discussion -- that this will not be supported. Check out this thread for reasoning and work around: https://github.com/ryanb/cancan/issues/274#comment_888081