Rails‎ > ‎

Rails - routing

The URL in rails has a meaning.
The default template is :

  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'

This means that if I want to have a book library (for example), I can do the following method :

... LibraryController ...

def book

When the URL is


The thing to note here is that the ID appears as a param by default - since it is in the URL.