This is an assumption based on my experience with Rails 2, but here's what I think happens:
If you created your controller with the scaffold parameter (which is still in Rails 3, right?), It would create a model in addition to your controller and add the appropriate routes by calling map.resources (or the equivalent of Rails 3) - this last bit is what gives you the routes /models you expect.
But since you just generated the controller, the model was not created, and thus Rails doesn’t put in the map.resources operator in routes.rb - map.resources really only make sense when there is a model underlying your controller . In fact, I do not think that it adds any special routes when creating the controller; you get to your index along one of the default routes: /:controller/:action .
So, if you want to go to your index with /blog , you will have to add the route yourself. Fortunately, it has to be single-line.
Hope this helps!
PS: If you are paranoid, you need to disable these routes by default before you start production - they allow GET requests to trigger actions that modify your database (for example, GET:/blog/destroy ), opening you before the attack fake requests .
source share