新手问题 [无厘头解决] Heroku routes 使用 namespace 导致 RoutingError

zisasign · August 08, 2013 · Last by zisasign replied at August 09, 2013 · 2178 hits

routes.rb 中

namespace :relationships do
    resources :investments
  end

Investments Controller 是简单的 scaffold 生成。 在本地的 development 和 production 环境中都是没问题。

但一部署到 Heroku 上就出现这个错误:

ActionController::RoutingError (No route matches {:action=>"edit", :controller=>"relationships/investments", :id=>#<Investment....

出问题的应该是 index 的 table 表中的 edit_relationships_investment_path 的调用。 heroku run rake routes的列表中是有这项的。

其他 new,create 都正常。

问题是出在哪里了呢?

删掉重建了 Heroku 上的 app,就好了……

You need to Sign in before reply, if you don't have an account, please Sign up first.