2013-07-16 72 views
0

我試圖設置(??),跟在this site, 之後,我成功設置了根索引以顯示"hello Rails"。在該教程,文件routes.rb必須更改爲:設置root不能正常工作

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

回答

8

您需要刪除以下靜態文件:

public/index.html 

的Rails附帶了一組提供基本功能外的開箱靜態文件。在index.html的情況下,加載根路徑時默認顯示的內容。在刪除之前,它會繼續覆蓋根路線。

+0

非常感謝,現在我可以繼續我的練習。 :D – Uchsun

1

您必須刪除public/index.html

+0

非常感謝你:) – Uchsun