Routes problems

Hello.
I have many links like these:
/articles/…
/albums/…
/photos/…
etc.

I need to use the name of the city in the beginning of urls if the
user has choosed it:
/city_name/articles/…
/city_name/albums/…
/city_name/photos/…

But previous links shoul work too (/articles/…, /albums/…)

I tried this:

map.articles ‘/articles/’, :controller => “zags”, :action =>
“cities”, :using_city => 1
map.articles ‘/:city_url/articles/’, :controller => “zags”, :action =>
“cities”, :using_city => 1

<%= link_to “London articles”, articles_path, { :city_url =>
“london”, :using_city => 1 } %>

But it does not work.
What should I change?
I know, that I can change one of map names “map.articles”, but I want
to use the same route names in my View code.How can I do it?

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