Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 5. A Working Sample > A RESTful Application

5.3. A RESTful Application

The file config\routes.rb defines how URLs are mapped to controllers and their methods (actions, in Rails speak). For example, in the previous paragraph you mapped the controller Articles with the root of your Rails application.

In traditional Rails applications — if the word "traditional" can be used for such a young framework — URLs have the following format by default :controller/:action/:id, as briefly discussed in Chapter 2. So /articles/show/3 would trigger the show action defined within the ArticlesController and pass a parameter id to it, whose value is 3. Similarly, /articles/edit/3 would trigger the edit action of the same controller on the same object, and /articles/update/3 would do the same for the update action.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial