Pretty Restful Resources

written by Cyx on February 21st, 2007 @ 09:53 PM

Have you ever questioned the rails way? We have.;edit

I’ve always had an itchy feeling when coding for this kind of URL ever since restful rails got out. Looking into resources.rb, we came up with a plugin that makes that URL look like this :

So far, we haven’t had any problems yet. Nesting doesn’t also reveal any problems. We have declarations like :

map.resources :admin do |admin| admin.resources :products, :name_prefix => 'admin_' do |product| product.resources :sections, :name_prefix => 'admin_products' end end

Nothing seems to be broken as of now.

If you’re interested, check out the plugin @ svn://


Post a comment