2010-12-09 14 views
1

Mon routes.rb a les 2 lignes suivantes:Questions sur les routes Rails3 de base?

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

Lorsque je tape localhost:3000/main/index dans un navigateur, je vois la page appropriée (views/main/index.html.erb).

Cependant, si je tape juste localhost:3000, je vois public/index.html (je m'attends à voir également views/main/index.html.erb).

Qu'est-ce qui me manque?

Répondre

2

Supprimer public/index.html:

rm public/index.html 

Cela se produit parce que les fichiers statiques (ceux en public/) sont servis en priorité aux routes.

+0

Super, merci! –