设置root不工作

时间:2013-07-16 04:31:55

标签: ruby-on-rails ruby

我想在this site之后设置(??), 我成功地将根索引设置为显示"hello Rails"。在该教程中,文件routes.rb必须更改为:

Blog::Application.routes.draw do
  get "welcome/index"

  # The priority is based upon order of creation:
  # first created -> highest priority.
  # ...
  # You can have the root of your site routed with "root"
   root to: "welcome#index"  #I just make this uncomment to set my hello rails show on index

 end

但它仍然无效。谁能帮我?我使用Windows 7。

2 个答案:

答案 0 :(得分:8)

您需要删除以下静态文件:

public/index.html

Rails附带一组静态文件,可提供开箱即用的基本功能。对于index.html,它是加载根路径时默认显示的内容。在它被删除之前,它将继续覆盖你的根路径。

答案 1 :(得分:1)

您必须删除public/index.html