I am having another ruby nuby moment and can't seem to wrap my head around this simple problem.
I have this as a route:
resources :pages
I have this in my pages controller:
def testy
end
and I have this in app/views/pages/testy.html.erb
<h1>Testy</h1>
I am trying to access the page like so: http://localhost:3000/pages/testy
And I get the following error:
Couldn't find Page with ID=testy
Here is the log:
Started GET "/pages/testy" for 127.0.0.1 at Thu Dec 09 14:24:51 -0600 2010
Processing by PagesController#show as HTML
Parameters: {"id"=>"testy"}
[1m[35mPage Load (0.3ms)[0m SELECT "pages".* FROM "pages" WHERE ("pages"."id" = 0) LIMIT 1
Completed in 12ms
ActiveRecord::RecordNotFound (Couldn't find Page with ID=testy):
app/controllers/pages_controller.rb:11:in `show'
It's obvious by the log that it's trying to access #show, but why? I think it's a problem with my route. Can someone give me a quick pointer?
I was following the Rails Guides here and I think this is what is throwing me off "... the rule is that if you do not explicitly render something by the end of the controller action, rails will look for the action_name.html.erb template in the controllers view path and then render that, ..."