Howto Make simply_restful Useful For Real People

Posted by Jeremy Voorhis Fri, 28 Jul 2006 04:11:00 GMT

For those rare occasions when a numerical sequence is not enough…

  1. Open vendor/plugins/simply_restful/lib/simply_restful/routes.rb
  2. Change line 30 from
    member_path = "#{path}/:id"
    to
    member_path = options.delete(:member_path) || "#{path}/:id"

Now you can specify your routes as follows:


  map.resource :entry, :member_path => 'entries/:year/:month/:day/:permalink'

Comments

  1. Jamie Hill said about 11 hours later:

    This should DEFINITELY be the default behavior of Simply RES Tful, I came across an issue just yesterday where I needed this kind of functionality.

    It would be quite nice if it was inside the :member hash item i.e.

    <code>map.resource :entry, :member => { :path => ‘entries/:year/:month/:day/:permalink’ }</code>

    I’m using Simply RES Tful a lot now. Keep a check at thelucid.com/articles/category/simply-restful

(leave url/email »)