ruby-on-rails - ActionController::RoutingError(未初始化的常量 IndexController
问题描述
我有一个关于 ruby on rails 的项目,我做了一个脚手架,然后我得到一个错误,没有路由匹配 [GET]“/info/routes”,然后我将此行添加到 routes.db。
root :to => 'index#index'
现在它给了我这个错误,我找不到解决方案。
ActionController::RoutingError (uninitialized constant IndexController Did you mean? IndexError):
有人知道解决方案吗?
解决方案
实际上我正在做一个 API 项目,但它抱怨没有索引。我修改为 root :to => 'alunos#index' 并且成功了!
推荐阅读
- excel - Best Fit 包 - VBA 请求
- javascript - 如何在整个会话中保持 select 的值
- django - django rest 框架中的路径错误:不支持在 include() 中指定命名空间而不提供 app_name
- php - MacOS XAMPP 访问禁止错误 403 - 您无权访问请求的目录
- c# - 如何在 C# 中的 datagridview 中撤消第二天删除的行?
- mongodb - 400 错误请求
- javascript - 对象解构与分配(性能)
- scala - 使用Scala列出给定HDFS路径的所有子目录到一定深度?
- git - 我尝试迁移 Azure Devops 中的一个工作项,该工作项具有指向 git 存储库中分支的链接,但该链接没有被迁移
- ios - 使用 Vuforia 8.5.9 构建 Unity iOS 版本 2019.3.0f1 时出现此构建时间错误