新手问题 Rails 4 localhost:3000 这个页面是从哪里来的?

autumnwolf · October 05, 2014 · Last by leekelby replied at October 05, 2014 · 3357 hits

http://guides.rubyonrails.org/v4.0.8/images/getting_started/rails_welcome.png Rails < 4 在 public 目录下会有这个页面,rails 4 这个页面是从哪里来的呢?

rails 这个 GRM 里面的

在 rails 这个 gem 里面,welcome/index.html.erb

Processing by Rails::WelcomeController#index as HTML
  Rendered /Users/WuQi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/templates/rails/welcome/index.html.erb (2.0ms)
cd /Users/WuQi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/railties-4.1.5/lib/rails/templates/rails/welcome
➜  welcome  ls
index.html.erb

@springwq 噢 知道了 谢谢!

2 楼已经回答你了,Rails 默认有:

WelcomeController 新建 Rails 项目时,默认首页 index

MailersController 邮件预览的 index 和 preview 页面

InfoController 项目信息页面,包括:index、properties、routes

You need to Sign in before reply, if you don't have an account, please Sign up first.