【发布时间】:2014-08-13 12:24:20
【问题描述】:
我生成了一个名为 Doctors 的扩展。
我正在尝试使用以下指南 http://refinerycms.com/guides/extending-controllers-and-models-with-decorators 使用装饰器扩展默认功能。
装饰者:
Refinery::PagesController.class_eval do
before_filter :find_doctors, only: [:doctors]
protected
def find_doctors
@find_doctors = Refinery::Doctors::Doctor.all
end
end
如果我将 [:doctors] 替换为 [:home],我可以在主页中看到对象,但我想在 Doctor index 视图中显示这些项目。
我错过了什么?
【问题讨论】:
标签: refinerycms