gpt4 book ai didi

ruby-on-rails - 配置 Controller 但出现错误 ActionNotFound

转载 作者:太空宇宙 更新时间:2023-11-03 17:12:00 25 4
gpt4 key购买 nike

我是否正确配置了默认路由?目前我的路线设置为:

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com