【发布时间】:2014-07-25 18:09:55
【问题描述】:
现在我有一个带有自定义模板的页面。
我想在页面装饰器中像这样在过滤器之前使用装饰器:
before_filter :get_gallery_index, :only => [:gallery_main]
要定义这个方法,我想声明类似的东西:
def get_gallery_index
# a = Refinery::Page.where(id: 6).children <- would be ideal
end
当然,children 不是 Refinery Pages 和 ActiveRecord 的有效方法。有没有人建议我如何获得这些记录?
【问题讨论】:
标签: ruby-on-rails ruby activerecord refinerycms