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

autumnwolf · 2014年10月05日 · 最后由 leekelby 回复于 2014年10月05日 · 3355 次阅读

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

需要 登录 后方可回复, 如果你还没有账号请 注册新账号