2013-08-21 92 views
1

我已經使用的Rails 3.0的routes.rb它的工作原理well.But現在,我升級的Rails 4.0那麼這個路線導致無路由匹配[GET]「/項目/ 12323 /付款」軌道4路線的約束條件錯誤

match "project/:id/payment" => "project#payment", :as => "project_payment", :via  => :get, :constraints => { :protocol => Rails.env.production? ? 'https' : 'http' } 

如果我刪除:constraints => { :protocol => Rails.env.production? ? 'https' : 'http' },它再次工作。我想問題是:約束語法,但我不確定。

你知不知道我該如何解決?

+0

你在生產中訪問它嗎?你使用什麼協議? – sevenseacat

+0

我正在開發中訪問它,但它也必須使用'http' –

回答

1

我有同樣的問題。試圖改變httpshttp分別https://http://

1

相反的 'https' 的,說/ HTTPS/

爲我工作。