Different route, same path/url calling in Rails
November 26, 2009 • Ruby on Rails • Comments
I had the following problem to solve using rails:
- Having 2 Subdomains, www and clients
- a client always has a path-prefix to use google analytics for each of this subdirs. so i had the following urls:
www.domain.tld/foo.html and clients.domain.tld/3kunsdf7w/foo.html - I did not want to have a code on www.
- i did not want to alter all tempaltes with new paramters and differen routes
Solving this, it was ok for me to duplicate all routes with a client_ prefix using textmate, so i took onl 4 seconds.. but what next, how to tell rails to use the clients_xy_path when i call xy_path?