Hi,

On Feb 1, 4:54 pm, daociyiyou <[email protected]> wrote:
> If i have the following routes:
> ###############
> map.connect "blog/:controller/:action/:id"
> map.connect "product/:controller/:action/:id"
> ##############
> when use url_for or some else to generate the url,how to make sure
> that url_for use the first route to generate the url "blog/articles/
> show/1" ?
> what to add to the
> url_for(:controller=>"articles",:action=>"show",:id=>"1") ?
> like this?
> url_for
> (:controller=>"articles",:action=>"show",:id=>"1",:anchor=>"blog")

Why not use this route:
map.resources :articles, :as => 'blog'

Then you can call article_path(@article)
For all routes that map.resources creates do a 'rake routes' on the
console.

ciao, tom

--
Thomas R. "TomK32" Koll <> http://ananasblau.com
just a geek trying to change the world
http://github.com/TomK32
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to