我有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