The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
What's New in Edge Rails: Restful Routes

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jeremy Voorhis

Posts: 212
Nickname: jvoorhis
Registered: Oct, 2005

Jeremy Voorhis is a Rubyist in northeast Ohio.
What's New in Edge Rails: Restful Routes Posted: Jul 31, 2006 5:05 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jeremy Voorhis.
Original Post: What's New in Edge Rails: Restful Routes
Feed Title: JVoorhis
Feed URL: http://feeds.feedburner.com/jvoorhis
Feed Description: JVoorhis is a Rubyist in northeast Ohio. He rambles about Ruby on Rails, development practices, other frameworks such as Django, and on other days he is just full of snark.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jeremy Voorhis
Latest Posts From JVoorhis

Advertisement

While I’m no Ryan Daigle1, I do subscribe to the Rails trac RSS feed and decided to speak up after watching this changeset roll in.

simply_restful began its life as a plugin, and at RailsConf, the core team announced that it would be merged into Rails core.

simply_restful has been merged into Rails core. Its functionality seems basically intact, with one minor adjustment: resource names are now pluralized. This means that in your routes.rb file, you must specify


  map.resource :entries

instead of


  map.resource :entry

The same goes for the companion method resources, which allows you to declare multiple resources at once.

In addition to providing clean URLs which respond to multiple HTTP methods, simply_restful also allows you to specify additional actions which respond to certain verbs like so:


  map.resources :comments, :member => { :approve => :post }

In this case, the url /comments/1;approve would be created. The rationale is to use the path to the left of the semicolon for a resource’s identity, and to use the path to the right of the semicolon as a modifier. Frequently this modifier would be an operation that you would perform on the resource, such as approving a comment that requires moderation.

In the plugin version of simply_restful, there was a bug which allowed only one additional action per HTTP method – you could not have two semicolon-style URLs which accepted the GET method, for example. This bug has been fixed.

I have yet to verify whether the pluralization issue affects this incarnation of simply_restful, but this would be a good time to release a plugin of my own that scratches an itch of mine since the plugin was released.

1 While the Rails changeset log is certainly available for everyone to read, Ryan provides a good service for anyone who wants a periodical synopsis of the latest changes, rather than a constant trickle. Thanks, Ryan!

Read: What's New in Edge Rails: Restful Routes

Topic: Elisp function Previous Topic   Next Topic Topic: ZenTest is released

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use