Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

“Rails Refactoring” by Trotter Cashion

By Peter Cooper / May 15, 2007


Rails Refactoring is an e-book written by Trotter Cashion (of MotionBox) and published by Addison-Wesley. Targeting developers who are tentatively dipping a toe into the world of REST, Rails Refactoring looks at how to turn your old-fashion unRESTian Rails code into the modern REST-capable equivalent. The first major section, for example, delves into respond_to and provides a 'motive', the 'steps' for implementation, and example code samples to back up the steps. Other refactorings, such as CRUD routing and ActiveResource are presented in a similar 'motive', 'steps' and 'examples' format.

Beyond basic refactoring, the e-book has several chapters covering controllers, routes, views, tests, authentication, and the consumption of external REST APIs all from a REST point of view. The RESTful Controllers chapter gets as far as explaining the methods involved, to_xml and MIME content types before the RESTful Routes and Views chapters look at the generation and integration of RESTful URLs in your applications. Curiously, the RESTful Tests and RESTful Authentication chapters are only two pages a-piece with only very cursory information.

At only 74 pages, Rails Refactoring is a quick read and littered with practical knowledge. I fear, though, that any Rails developer who doesn't already use respond_to or have a cursory knowledge of REST is unlikely to be tempted by the examples on show here, and more experienced developed will find Rails Refactoring a little simple going. Still, it's useful information that's well presented, and could make a useful reference to any Rails developer. It costs $14.99 direct from Addison-Wesley or you can read it for free if you're already a member of Safari (an online book system by O'Reilly Media and Pearson Technology Group).

(WARNING: There have been some issues reported about the DRM used within the PDF download. Read the comments left by readers on this post before purchasing.)


  1. topfunky says:

    I like the fact that most of the book covers the transition from non-REST code to REST. There's sometimes an assumption in the community that every Rails app runs on edge and that changes from one version to the next are trivial. Mr. Cashion doesn't make that assumption and provides some useful advice.

  2. Pawel says:

    I bought this without realizing that the PDF was DRM encumbered. Yuck! I wouldn't have bought it if I had known, and I'm thinking that I will definitely avoid Addison Wesley ebooks in the future.

  3. Peter Cooper says:

    Thanks for bringing that up, Pawel. It is rather annoying, I know, especially as the DRM is not made clear on the sales page.

  4. André B. says:

    I found out about the DRM after struggling with the Reader. During this struggle I managed to download the eBook 5 times, so now I get a message that I have downloaded the book to many times and I'm not able to open the book at all. I know for sure that this is the last time I ever buy a eBook from Addison Wesley!!

  5. Mark says:

    What DRM is used on the book? Any idea what it will/won't let me do?

  6. Peter Cooper says:

    I have added a stern warning to the post about the DRM used here, and will try to implement a policy of posting about DRM issues on future posts where it may be necessary. Unfortunately the sales page does not mention DRM (which is my biggest beef with this, not the DRM itself).

    I was provided with a non-DRM encumbered version for my review, so unfortunately I cannot explain what DRM is used. I will point my contact to this post in case they want to answer questions or comment on this issue.

  7. Peter Cooper says:

    I don't want to give more information than is necessary from my source, as they'll soon be coming here to resolve this themselves.. but allegedly there isn't meant to be DRM on this and it might be fixed shortly. Keep eyes peeled here for more news..

  8. Peter Cooper says:

    An update from Marie McKinkley, Marketing Manager at Addison-Wesley.. good news!:

    Last summer, we made the decision to release all Short Cuts in the
    Addison-Wesley Professional Ruby series without DRM. However, our
    company's standard operating procedure for digital products is to have
    DRM applied, so the Ruby Short Cuts need to follow a special production
    process. In this case, Trotter Cashion's work took a wrong turn down the
    production line and ended up with DRM. We've been trying to fix this
    issue for a couple of weeks already. I will contact everyone who bought
    this Short Cut to offer them the DRM-free file.

    Good news for everyone :)

  9. Pawel says:

    Awesome news - thanks Peter!

  10. jt says:

    That is good news. I was going to bite but as soon as I saw the DRM I dropped the idea like a stone. Was consoled in my decision thanks to the ohers who reported problems. I'll wait for the DRM to get fixed.

Other Posts to Enjoy

Twitter Mentions