我目前正在尝试让我的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'
我的佣金路线正确地给出了路线。 有关如何解决此问题的任何建议吗?
答案 0 :(得分: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'