0

在 Cucumber 上注册测试设备时遇到问题。单击“注册”后,它显示 未初始化的常量 User::ArticlesController (ActionController::RoutingError) 我想这是因为在注册后,设计将登录的用户重定向到文章页面,但它不在命名空间用户下。因为我测试用户,所以它把所有东西都放在这个命名空间下。

4

1 回答 1

0

这个 Devise howto说你可以通过命名 user_route 路径来路由到不在 User 命名空间下的东西:

match 'my/dashboard' => 'my/dashboard#index', :as => 'user_root'

所以听起来你可以做类似的事情:

match 'articles' => 'articles#index', :as => 'user_root'
于 2011-03-30T21:56:47.053 回答