我已經嘗試了一切,我未能解決這個問題,所以我來到這裏:)。我有以下工作在本地完善,但由於某種原因,當我推到heroku時,它會中斷。Heroku current_page?休息
我我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中突破?提前致謝。
編輯:
我使用的是雪松堆棧的應用程序,在我的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
它是如何突破的?你得到什麼錯誤信息?你在什麼heroku堆棧? – corprew
謝謝你的回答我編輯了我原來的帖子,以顯示你問的問題:) –