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

zisasign · 2013年08月08日 · 最后由 zisasign 回复于 2013年08月09日 · 2178 次阅读

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,就好了……

需要 登录 后方可回复, 如果你还没有账号请 注册新账号