首页 > 解决方案 > ActionController::RoutingError(未初始化的常量 IndexController

问题描述

我有一个关于 ruby​​ on rails 的项目,我做了一个脚手架,然后我得到一个错误,没有路由匹配 [GET]“/info/routes”,然后我将此行添加到 routes.db。

root :to => 'index#index'

现在它给了我这个错误,我找不到解决方案。

ActionController::RoutingError (uninitialized constant IndexController Did you mean?  IndexError):

有人知道解决方案吗?

标签: ruby-on-railsherokuscaffolding

解决方案


实际上我正在做一个 API 项目,但它抱怨没有索引。我修改为 root :to => 'alunos#index' 并且成功了!


推荐阅读