Question: New to Rails, and following a tutorial that starts by creating the classic blog application.

Running: Rails 3.2.3 and Ruby 1.9.2

Started by creating a new Rails project, then generating scaffolding to create an Entry controller and views. Then used rake db:migrate to create the entries table on a mysql database server.

Started the Rails server (WEBrick 1.3.1), and pointed my browser to 0.0.0.0:3000/entries and it works fine, going to the index action by default.

But I was surprised to see that trying to point my browser to /entries/index returned an error. My entries controller includes the following actions: index, show, new, edit, create, update, destroy. Of these, only going to /entries/new actually works, the rest seem to be over-ridden by the :id default. 

routes.rb contains two lines:

Mydiary::Application.routes.draw do

resources :entries

I thought the default format for accessing the actions of a controller was http://[hostname]/[controller]/[action]. So while it makes sense that not giving an action defaults to index, it frankly blew my mind that http://[hostname]/entries/index wouldn't work. What possible reason could there be for this? Checking the rest it looks like only the new action works. All the rest are overridden by :id.

This doesn't fit with what it says in the tutorial, by the way, which tells me this is new in Rails 3.

So I guess my question is, where can I find which actions are over-ridden by the :id action by default, and which aren't? Very frustrating...

Answer: 
run `rake routes` and you'll see output that looks something like this:

```
entries     GET      /entries(.:format)           entries#index
            POST     /entries(.:format)           entries#create
new_entry   GET      /entries/new(.:format)       entries#new
edit_entry  GET      /entries/:id/edit(.:format)  entries#edit
entry       GET      /entries/:id(.:format)       entries#show
            PUT      /entries/:id(.:format)       entries#update
            DELETE   /entries/:id(.:format)       entries#destroy

```

Basically, this results in:

* Get a listing of entries, do `GET /entries`.
* Post the data from a form to create a new record, `POST /entries`
* Get a form to create a new entry, do `GET /entries/new`
* Edit a **specific entry**, `GET /entries/:id/edit`
* Show the details of a **specific record**, `GET /entries/:id`
* Update the values for a **specific entry**, `PUT /entries/:id`
* Delete/Destroy a **specific record**, `DELETE /entries/:id`

A great place to start learning all this is the Rails Guide - [Rails Routing from the Outside In](http://guides.rubyonrails.org/routing.html).
To see routes for specific controller:

CONTROLLER= rake routes
eg: CONTROLLER=documents rake routes

For Namespace:

CONTROLLER=api/facebooks rake routes

CONTROLLER=admin/users rake routes