I'm trying to set up named routes for page:
www.myhost.com/blog/about
(map.about '/about', :controller => 'page', :action => 'about')
And I have another route for a resource:
www.myhost.com/blog/post/3
(map.resources :posts)
Now I don't know how should I link to "about" page. If I use
- a)
<%= link_to 'About', about_url %>
or - b)
<%= link_to 'About', 'about' %>
It works fine only when I go to blog/posts
and blog/about
. When I open blog/post/1
, then the link to about page gets an url blog/post/about
.
How can I force it to make an absolute path from the application root?