Free Trial

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

Share this Page URL
Help

Chapter 3. REST, Resources, and Rails - Pg. 55

C HAPTER 3 REST, Resources, and Rails REST Before REST came I (and pretty much everyone else) never really knew where to put stuff. --Jonas Nicklas on the Ruby on Rails mailing list With version 1.2, Rails introduced support for designing APIs consistent with the REST style. Representational State Transfer (REST) is a complex topic in information theory, and a full exploration of it is well beyond the scope of this chapter. 1 We'll touch on some of the keystone concepts, however. And in any case, the REST facilities in Rails can prove useful to you even if you're not a REST expert or devotee. The main reason is that one of the inherent problems that all web developers face is deciding how to name and organize the resources and actions of their application. The most common actions of all database-backed applications happen to fit well into the REST paradigm. 3.1 REST in a Rather Small Nutshell REST is described by its creator, Roy T. Fielding, as a network architectural style, specif- ically the style manifested in the architecture of the World Wide Web. Indeed, Fielding is not only the creator of REST but also one of the authors of the HTTP protocol itself. REST and the web have a very close relationship. 1. For those interested in REST, the canonical text is Roy Fielding's dissertation, which you can find at http://www.ics.uci.edu/fielding/pubs/dissertation/top.htm . In particular, you'll probably want to focus on Chapters 5 and 6 of the dissertation, which cover REST and its relation to HTTP. You'll also find an enormous amount of information, and links to more, on the REST wiki at http://rest.blueoxen.net/ cgi-bin/wiki.pl . 55