REST and ActiveResource

REST (Representational State Transfer)
REST is An Architectural Style
It uses the following standards:

    *  HTTP
    * URL
    * XML/HTML/GIF/JPEG/etc (Resource Representations)
    * text/xml, text/html, image/gif, image/jpeg, etc (MIME Types)
The Whole WWW is a REST system!



HTTP methods: PUT, GET, POST and DELETE.
database operations: CREATE, READ, UPDATE, DELETE (CRUD)

URI -> Resource
REST Is a Conversation
The verbs of the REST conversation are the aforementioned request methods, while the nouns are URIs, A URI should be only a pointer to a resource.
GET "/books/1"
DELETE "/books/1"

A Uniform Resource Identifier (URI), is a compact string of characters used to identify or name a resource.

A Uniform Resource Locator (URL) is a URI that, in addition to identifying a resource, provides means of acting upon or obtaining a representation of the resource by describing its primary access mechanism or network "location".

Uniform Resource Name (URN) is a URI that identifies a resource by name in a particular namespace. (e.g. urn:isbn:0-395-36341-1)

Web service, a software system designed to support interoperable Machine to Machine interaction over a network.

Remote Procedure Call (RPC)

REST Is Design
A clear approach to controller-design that’ll reduce complexity for the implementer and result in an application that behaves as a much better citizen on the general web.

REST gives us a framework for simple but extensible application design.

RailsConf Keynote: David Heinemeier Hansson Video the World of Resources
online video:
download address:
(the slides

David Heinemeier Hansson’s blog on ActiveResources

script/generate scaffold_resource
Rails Cookbook

转载请注明: 转自船长日志, 本文链接地址:

此条目发表在 Ruby on Rails, 信息处理 分类目录。将固定链接加入收藏夹。


电子邮件地址不会被公开。 必填项已用 * 标注


您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>