【发布时间】:2019-12-21 20:55:22
【问题描述】:
我正在学习 Rails 的 udemy 课程,我也尝试按照“Getting Started with Rails”中的指导进行操作, 但无论如何我的应用程序都找不到我的模板文件。
app/controllers/welcome_controller.rb:
# frozen_string_literal: true
# The welcome controller.
class WelcomeController < ApplicationController
def index; end
end
app/views/welcome/index.html.erb:
<h1>Hello, Rails!</h1>
config/routes.rb:
# frozen_string_literal: true
Rails.application.routes.draw do
get 'welcome/index'
root 'welcome#index'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
【问题讨论】:
-
在控制台和浏览器上显示错误。
标签: ruby-on-rails ruby