【发布时间】:2015-09-15 13:08:11
【问题描述】:
我有一个 RefineryCMS 的扩展程序。在该扩展中,我需要从 PagesController 中的对象块获取数据。
我的代码:
def show
if should_skip_to_first_child?
redirect_to refinery.url_for(first_live_child.url) and return
elsif page.link_url.present?
redirect_to page.link_url and return
elsif should_redirect_to_friendly_url?
redirect_to refinery.url_for(page.url), :status => 301 and return
end
@block = Refinery::Blocks::BlocksController::Block.find_by(:name => 'Footer')
render_with_templates?
end
在开发中第一次启动成功,但在刷新或重定向到另一个站点的页面之后:
uninitialized constant Refinery::Blocks::BlocksController::Block
【问题讨论】: