我是否正确配置了默认路由?目前我的路线设置为:
root :to => 'proto#index'
当我这样做时,我收到以下错误:
AbstractController::ActionNotFound (The action 'index' could not be found for ProtoController):
我需要更改什么文件?
最佳答案
您正在寻找 app/controllers/proto_controller.rb
它应该包含如下内容
class ProtoController < ApplicationController
def index
end
end
然后你想在 app/views/proto/index.html.erb 创建一个包含页面 html 的文件。
关于ruby-on-rails - 配置 Controller 但出现错误 ActionNotFound,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12358763/