Rails public 文件夹中的 index 在哪?

linusliu · 2014年07月05日 · 最后由 pynix 回复于 2014年07月05日 · 3132 次阅读

最近在学习 rails,书上说每个项目的 public 文件夹都会有 Index.html 文件以对应首页。挺奇怪的,我的 public 文件夹里面没有 index.html,这是怎么回事?

新版的已经没有了

这个怎么解释好呢?这个文件是给 webserver 的,和 rails 没多大关系。。。

In Rails 4 the static index.html file has been removed from the public directory and the functionality has been moved to a dynamic route instead. This means that you no longer have to delete public/index.html every time you start a new Rails application.

A new Rails internal controller Rails::WelcomeController has been introduced to serve the dynamic welcome screen. If your application does not have a root route defined in routes.rb, it will render the rails/welcome#index action instead.

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