Nested REST resources with Rails 1.2

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Nested REST resources with Rails 1.2 - Presentation Transcript

    1. RESTful Routing Basics RoR Meetup, 1/18/2007 Andre Lewis
    2. What You’ll Learn
      • Getting started with RESTful resources in Rails 1.2
      • Using scaffold_resource
      • How to nest resources
    3. Motivation
      • Why care about REST?
      • What can REST do for you?
      • Fewer decisions to make
      • More easily understand other’s work, or your own older work
      • Nice URLs
      • Convenient named routes
      • XML/JS/JSON responses, easier
    4. The REST Mindset
      • Think in terms of:
        • C reate  GET /items/new
        • R etrieve  GET /items/1
        • U pdate  PUT /items/1
        • D elete  PUT /items/1;delete
      • Let the constraints imposed by CRUD guide your controller design
    5. Let’s code a Nested Resource
    6. Review: Nested Resources
      • Create the resource scaffolding and migrations
      • Set up relationships in models
      • Modify routes.rb
      • Modify the controller of the nested resource
        • add a before_filter
        • amend the *_url calls in create and update actions
        • scope your Comment (nested class) finders to the Post (nestee class)
      • Modify the views
      • Provide a link to the nested resource
    7. REST: Learn More
      • My blog post at http://earthcode.com
      • DHH's REST keynote (get the slides too!)
        • http://www.loudthinking.com/lt-files/worldofresources.pdf
        • http://www.scribemedia.org/2006/07/09/dhh/
      • The 2nd edition of Pragmatic's Agile Web Development
      • Peepcode screencast and cheatsheet
      Questions/Feedback?
      • what about *optionally* nested resources?
      • What about the new/edit request.get? pattern?
      • Is it “bad” to put additional methods on your RESTful controllers?
    8. My Info Book http:// earthcode.com Blog [email_address] Email

    + aclacl, 3 years ago

    custom

    6047 views, 1 favs, 0 embeds more stats

    A presentation on RESTful routing and resources in more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 6047
      • 6047 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories