Forum: Ruby on Rails using variable in :path_prefix

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
82a578052d304559f15180bdf56555d2?d=identicon&s=25 Tarscher (Guest)
on 2007-06-10 03:33
(Received via mailing list)
Hi all,

I have a couple of restful controller. I use path_prefix to add a
string to the path.

I have a club controller and model and it's the club id I want in
the :path_prefix

in my routes I have:
  map.resources :clubs
  map.resources :users, :path_prefix => :club
  map.resources :posts, :path_prefix => :club
  map.resources :user, :path_prefix => :club
  map.connect ':club/', :controller => 'club', :action => 'index'
  map.connect ':club/:controller/:action/:id'
  map.connect ':controller/service.wsdl', :action => 'wsdl'

I read the :club parameter in in application controller. Everytime a
user enters a url I thus set the club id eg.
sets the club id to zero.

When I use new_post_path I don't get but

Someone has an idea what I do wrong?

This topic is locked and can not be replied to.