Skip to Main Content
Learning Rails
book

Learning Rails

by Simon St. Laurent, Edd Dumbill
November 2008
Beginner content levelBeginner
448 pages
12h 25m
English
O'Reilly Media, Inc.
Content preview from Learning Rails

REST and Controller Best Practices

REST is an approach to building web applications that takes as much advantage of the underlying structure of the web as possible. This makes a lot of things more comfortable:

  • Users will find that the applications work as they’d like in their web browsers. They can bookmark pages and come back to them, and the URLs are actually meaningful.

  • Network administrators can use all their preferred techniques for managing web traffic without worrying about disrupting an application.

  • You, of course, get the greatest benefits. REST-based architecture is a very neat fit with Rails’ MVC approach, and makes it easier to keep track of which code does what where. Rails 2.x is also set up to make it extremely easy for you to use REST, supporting a number of ways for you to say, “I’d like this to behave RESTfully.”

REST doesn’t create new techniques so much as dust off old techniques and encourage developers to use them as they were designed to be used. Of course, even early in the Web’s development, developers hacked and slashed their way into a different style of programming, so there are some adjustments to make. Fortunately, Rails makes it easy to adjust and opens new horizons in doing so.

Note

REST stands for REpresentational State Transfer, which describes what happens but isn’t the most immediately meaningful explanation.

Websites and Web Applications

Web developers have historically used two HTTP methods to get information into and out of sites: GET and POST. On ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Rails 5

Learning Rails 5

J. Mark Locklear, Eric J Gruber, Barnabas Bulpett
Mastering Ruby Closures

Mastering Ruby Closures

Benjamin Tan Wei Hao
Ruby on Rails® Bible

Ruby on Rails® Bible

Timothy Fisher

Publisher Resources

ISBN: 9780596154943Supplemental ContentErrata