Rails Refactoring to Resources (Digital Short Cut): Using CRUD and REST in Your Rails Application
- By Trotter Cashion
- Published Apr 13, 2007 by Addison-Wesley Professional.
- Copyright 2007
- Dimensions: 10-1/2x7-3/4
- Pages: 74
- Edition: 1st
- Short Cut
- ISBN-10: 0-321-50174-8
- ISBN-13: 978-0-321-50174-5
Register your product to gain access to bonus material or receive a coupon.
Since David Heinemeier Hansson’s keynote speech at RailsConf 2006 and the release of Rails 1.2 in early 2007, Representational State Transfer, better known as REST, has taken the Rails world by storm. If you’re new to REST, this short cut will help you decide which parts of the REST paradigm you want to introduce to your application. If you’re a developer with more RESTful experience, this short cut will introduce you to some refactorings that will give your application a cleaner, leaner code base, while also serving as a reference to much of the functionality REST has brought to Rails.
Section 1: What This Short Cut Covers 3
Section 2: What Is REST? 6
Section 3: Refactorings 10
Section 4: RESTful Controllers 31
Section 5: RESTful Routes 48
Section 6: RESTful Views 54
Section 7: RESTful Tests 59
Section 8: RESTful Authentication 61
Section 9: Consuming RESTful APIs 63
Resources 72
About the Author 73
Excerpts
Table of Contents
Section 1: What This Short Cut Covers 3
1.1 Target Audience 5
1.2 Rails 5
Section 2: What Is REST? 6
2.1 REST Explained 7
2.2 REST and Rails 7
2.3 REST and CRUD 8
2.4 Verbs and Nouns 9
Section 3: Refactorings 10
3.1 respond_to 10
3.2 CRUD 16
3.3 Resource 27
Section 4: RESTful Controllers 31
4.1 A RESTful Controller 31
4.2 Automating RESTful Controller Generation 34
4.3 respond_to 40
4.4 How Content Type Negotiation Works 46
Section 5: RESTful Routes 48
5.1 Pretty URLs 52
5.2 Browsers and the HTTP Methods 53
Section 6: RESTful Views 54
6.1 SimplyHelpful
Section 7: RESTful Tests 59
Section 8: RESTful Authentication 61
Section 9: Consuming RESTful APIs 63
9.1 ActiveResource 64
9.2 cURL 69
Resources 72
About the Author 73

Short Cut $19.99
This PDF is easy to download and read -- no passwords or activation required. We customize your PDF by watermarking each page with your name in the lower right corner.
Your PDF will be accessible from your Account page after purchase and requires the free Adobe® Reader® software to read it.
We respect your choice for easy-to-use digital content and hope in return you will respect the hard work that went into producing it.
- Save more by becoming a member.
- Corporate, Academic, and Employee Purchases
Online access to books, videos, and tutorials from Addison Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media and others - starting as low as $22.99. Learn more and start a free trial.


Account Sign In
View your cart