我在 routes.rb 中定义了一个名为 centers 的资源。当我得到 localhost:3000/centers centers_controller 执行 show action 而不是索引时。根据 Ruby on Rails CRUD 文档,这不应该发生。
有什么想法吗?
最佳答案
我有一点。你在用吗
resource :centers
或
resources :centers
第二个选项有索引操作,第一个没有
关于ruby-on-rails - Ruby on Rails 执行显示而不是索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34458005/