Compress RailsBaseURI and controller into one path segment?

I would like to deploy a simple rest application via mod_passenger to a
sub-directory (RailsBaseURI) called /mailing_lists. The application
is very simple mand has a single top-level resource called mailing_lists
sub-resources of subscribers:

map.resources :mailing_lists, :path_prefix => nil do |mailing_lists|
mailing_lists.resource :subscriber, :only => [ :create, :new ]

$ rake routes
new_mailing_list_subscriber GET
{:controller=>“subscribers”, :action=>“new”}
mailing_list_subscriber POST
{:controller=>“subscribers”, :action=>“create”}
mailing_lists GET /mailing_lists(.:format)
{:controller=>“mailing_lists”, :action=>“index”}
POST /mailing_lists(.:format)
{:controller=>“mailing_lists”, :action=>“create”}
new_mailing_list GET /mailing_lists/new(.:format)
{:controller=>“mailing_lists”, :action=>“new”}
edit_mailing_list GET /mailing_lists/:id/edit(.:format)
{:controller=>“mailing_lists”, :action=>“edit”}
mailing_list GET /mailing_lists/:id(.:format)
{:controller=>“mailing_lists”, :action=>“show”}
PUT /mailing_lists/:id(.:format)
{:controller=>“mailing_lists”, :action=>“update”}
DELETE /mailing_lists/:id(.:format)
{:controller=>“mailing_lists”, :action=>“destroy”}

This means the resulting URIs with the /mailing_lists path
segment duplicated like this:


but I would like really to compress the first two path elements for the
uri and top-level controller into one. I tried :as => nil and :as => ‘’
is respectively ignored generates paths that do not actually work.

Any ideas?


Allan Wind
Life Integrity, LLC

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs