开发者

Basic Rails3 routes question?

开发者 https://www.devze.com 2023-01-29 08:48 出处:网络
My routes.rb has the followin开发者_C百科g 2 lines: match \"/\",:to => \"main#index\" match \"main/index\", :to => \"main#index\"

My routes.rb has the followin开发者_C百科g 2 lines:

match "/",          :to => "main#index"
match "main/index", :to => "main#index"

When I type localhost:3000/main/index in a browser I see the proper page (views/main/index.html.erb).

However, if I type just localhost:3000 I see public/index.html (I expect to see views/main/index.html.erb as well).

What am I missing ?


Remove public/index.html:

rm public/index.html

This is happening because static files (those in public/) are served in priority to the routes.

0

精彩评论

暂无评论...
验证码 换一张
取 消