In the previous chapter I created a Say controller which had a hello
action. But, the products controller has index, show, new, edit, create,
update and destroy.
I tried /products/new and products/index and still nothing…
What am I missing here?
The ‘No route matches…’ error usually suggests that something is
missing in your config/routes.rb file. At this point in the tutorial,
you should have:
somewhere in your config/routes.rb. Do you?
( This is a bit hard to diagnose, as you’ve noticed, because the
‘resource’-style routing adds some standard mappings that aren’t like
the explicit /controller/action mapping you were previously introduced
to. In this case, behind the scenes, the ‘map.resources :products’
adds a route that maps /products to ProductsController#index. You can
read more about this in the Rails Routing guide . It seems weird
and magical at first, but it’ll soon become second nature, trust me! )
I am really new to this (obviously) but, I think I had started Webrcik
in my demo directory and not the depot on which it should have been.
Another thing is that I found this website.
That shows using script/generate without a ‘/’ in the command. The book
uses this and it was causing an issue trying to run db:migrate. My
migration file had a space between the ‘:’ colon and the column name.
Once I fixed those things I can now get to the url just fine.
Trying to figure out the differences is a pain. The book says it is for
Rails 2 and I am running Rails 2.3.8 you’d think this would be a
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.