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
and
sub-resources of subscribers:

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

$ rake routes
new_mailing_list_subscriber GET
/mailing_lists/:mailing_list_id/subscriber/new(.:format)
{:controller=>“subscribers”, :action=>“new”}
mailing_list_subscriber POST
/mailing_lists/:mailing_list_id/subscriber(.:format)
{: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:

/mailing_lists/mailing_lists/…

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

Any ideas?

/Allan

Allan Wind
Life Integrity, LLC
http://lifeintegrity.com

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