我已经尝试了一切,但未能解决这个问题,所以我来到这里:)。我在本地完成了以下工作,但是由于某种原因,当我将其推送到 heroku 时它会中断。
我的 application.html.haml 模板:
%body
= render :partial => 'layouts/topbar'
- if user_signed_in?
- if current_page?(url_for(:controller => 'posts', :action => 'index'))
= render :partial => "layouts/flash_messages", :locals => {:flash => flash}
= yield
#go-top
Scroll to Top
- else
.container.main
= render :partial => "layouts/flash_messages", :locals => {:flash => flash}
= yield
- else
.container.main
= render :partial => "layouts/flash_messages", :locals => {:flash => flash}
= yield
有人可以指出我的错误吗?或者知道为什么这会破坏heroku?提前致谢。
编辑:
我正在使用 cedar stack 应用程序,并且在我的 heroku 日志中,尽管该路径确实存在:
2012-06-14T08:39:59+00:00 app[web.1]: Started GET "/user_root" for XXX.XX.XXX.XX at 2012-06-14 08:39:59 +0000
2012-06-14T08:39:59+00:00 app[web.1]: ActionController::RoutingError (No route matches {:controller=>"posts"}):
2012-06-14T08:39:59+00:00 app[web.1]: app/views/layouts/application.html.haml:27:in `_app_views_layouts_application_html_haml___40461595758832869_62063220'
2012-06-14T08:39:59+00:00 app[web.1]: Processing by HomeController#index as HTML
2012-06-14T08:39:59+00:00 app[web.1]:
2012-06-14T08:39:59+00:00 app[web.1]: Rendered layouts/_topbar.html.haml (3.6ms)
2012-06-14T08:39:59+00:00 app[web.1]:
2012-06-14T08:39:59+00:00 app[web.1]: cache: [GET /user_root] miss
2012-06-14T08:39:59+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (1.0ms)
2012-06-14T08:39:59+00:00 app[web.1]: Completed 500 Internal Server Error in 15ms