0

我目前正在尝试让我的 Ruby on Rails 应用程序在生产环境中运行。它工作正常,但是当我在嵌套命名空间下添加路由时,它给了我错误提示

ActionController::RoutingError(未初始化常量 Agent::Clients::AccountController)

这条路线在我的本地机器上运行良好,路线看起来像这样

namespace :agent do
root                     :to => redirect('url')
match 'dashboard',       :to => 'dashboard#index'
match 'account',         :to => 'account#edit'
match 'account/update',  :to => 'account#update'

namespace :clients do
  root              :to => redirect('url')

**# This part I added and is giving routing error**   
  match 'accounts/invite', :to => 'clients/account#invite'
  match 'accounts/sendinvite', :to => 'clients/account#send_invitation'

我的 rake 路线正确地给出了路线。任何建议如何解决这个问题?

4

1 回答 1

0

所以你要么想做

match 'accounts/invite', :to => 'clients/accounts#invite'
match 'accounts/sendinvite', :to => 'clients/accounts#send_invitation'

或者

match 'accounts/invite', :to => 'agent/account#invite'
match 'accounts/sendinvite', :to => 'agent/account#send_invitation'
于 2013-02-27T07:59:48.307 回答