开发者

Basic Rails3 routes question?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜