Resource Hacks plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install http://svn.planetargon.org/rails/plugins/resource_hacks
Allow me to illustrate:
map.resources :entries
gives us the member path /entries/1 where 1 is the value of params[:id]. With resource_hacks, you can still use a numeric id, but also declare an arbitrary member path like so:
map.resources :entries, :member_path => '/entries/:year/:month/:day/:permalink'
This gives us the member path /entries/2006/8/1/announcing_resource_hacks rather than /entries/1.
With this routing definition, you may send an HTTP request with the PUT method to update the Entry via EntriesController#update. The same goes for DELETE. The collection found at /entries will not be affected by resource_hacks.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago

