nested restful resources without controller name in the url

9 views
Skip to first unread message

Antonio Pardo

unread,
Mar 30, 2007, 2:53:20 PM3/30/07
to rubyonra...@googlegroups.com
hi,

first, sorry for my english.

i have this resources in routes.rb:

map.resources :artists, :path_prefix => '/music' do |artists|
  artists.resources :albums do |albums|
    albums.resources :tracks
  end
end

with this i have this type of url's:
/music/artists/the+pixies/albums/doolitle/tracks/debaser

my question is if it's possible to hide the controller name in the url somehow
to have url's of type:
/music/the+pixies/doolittle/debaser

if this possible?, breaks somehow the rest philoshopy?

thanks

--
http://debaser.homelinux.com/

brian.dainton

unread,
Mar 30, 2007, 3:40:31 PM3/30/07
to Ruby on Rails: Talk
Hi Antonio,

I don't have an answer for exactly how to construct the routes w/out
the controller names (sorry), but I read this post on Jamis' blog
recently and thought it might be relevant for you:
http://weblog.jamisbuck.org/2007/2/5/nesting-resources

- BD

> application_pgp-signature_part
> 1KDownload

Reply all
Reply to author
Forward
0 new messages