Ruby on rails 轨道';s localhost:“本地主机”;缺少“请求格式”的模板;?
我是Ruby Rails的新手,我正试图通过这个Youtube指南创建一个Rails页面Ruby on rails 轨道';s localhost:“本地主机”;缺少“请求格式”的模板;?,ruby-on-rails,Ruby On Rails,我是Ruby Rails的新手,我正试图通过这个Youtube指南创建一个Rails页面 https://www.youtube.com/watch?v=pPy0GQJLZUM 当我浏览页面时,我遇到了这个问题。当我试图打开localhost:localhost:3000时,它给了我这个通知 PostsController\index缺少请求格式的模板:text/html 在\app\views\posts中,我有这样一个index.html.erb文件 索引 在\app\controllers
https://www.youtube.com/watch?v=pPy0GQJLZUM
当我浏览页面时,我遇到了这个问题。当我试图打开localhost:localhost:3000时,它给了我这个通知
PostsController\index缺少请求格式的模板:text/html
在\app\views\posts
中,我有这样一个index.html.erb
文件
索引
在\app\controllers\posts\u controller.rb
中,我有这样的posts\u controller.rb
文件
class PostsController
在\config\routes.rb
中,我有如下routes.rb
文件
Rails.application.routes.draw do
根“posts#index”
结束
我是个新手,对这个问题很困惑。你能帮帮我吗?非常感谢。我很感谢你说你有一个,但是这个错误消息意味着
app/views/posts/index.html.erb
中没有文件-注意拼写错误和大写字母,正如你在视频中看到的那样,他们在index.html.erb
文件中这样写道index
,所以我遵循了他们,我错了吗?或者我需要更多的东西吗?正如马克所说,filname可能有问题,你能展示一下应用程序/viers/posts
?亲爱的朋友们,谢谢你们的评论。正如马克先生所说,这只是因为我的拼写错误。非常感谢。通常是这样,不客气:)