Mateus Pinheiro
Mateus Pinheiro

Reputation: 870

Rails 3 don't find index page

I'm having a little trouble here with Rails 3.

I've created a controller called Admin. I've also defined a method called index and a view in app/views/admin/index.html.erb.

The problem is that when i go to http://localhost/myapp/admin i get a "Route not Found Error", but when I go to http://localhost/myapp/admin/index i get to the page I want.

I'm posting some links to the code, so you can check if there is any error, ok?

http://pastebin.com/UctUq44G

Thanks!

Upvotes: 1

Views: 234

Answers (1)

David Lyod
David Lyod

Reputation: 1438

The issue is your routes.

There is no route for 'admin/'. This will add additional routes needed.

resources :admin

If your intention is to simply have semi static pages you can add

get 'admin'

Also some handy information :

http://guides.rubyonrails.org/routing.html#resource-routing-the-rails-default

Upvotes: 2

Related Questions