Ruby on rails 基本铁路路线问题?

Ruby on rails 基本铁路路线问题?,ruby-on-rails,ruby-on-rails-3,routes,Ruby On Rails,Ruby On Rails 3,Routes,Myroutes.rb有以下两行: match "/", :to => "main#index" match "main/index", :to => "main#index" 在浏览器中键入localhost:3000/main/index时,我会看到相应的页面(views/main/index.html.erb) 但是,如果我只键入localhost:3000我会看到public/index.html(我也希望看到views/main/index.html.e

My
routes.rb
有以下两行:

match "/",          :to => "main#index"
match "main/index", :to => "main#index"
在浏览器中键入
localhost:3000/main/index
时,我会看到相应的页面(
views/main/index.html.erb

但是,如果我只键入
localhost:3000
我会看到
public/index.html
(我也希望看到
views/main/index.html.erb


我缺少什么?

删除
public/index.html

rm public/index.html
之所以会发生这种情况,是因为静态文件(位于
public/
中的文件)优先于路由