When running rake routes I see:
Prefix Verb URI Pattern Controller#Action
articles GET /articles(.:format)
You can do something like this:
resources :articles do
collection do
get "new" => "articles#new", :as => 'new_document'
end
end
and you can use it:
link_to "New foo", new_document_path
or
link_to "New foo", new_document_url
url prints the absolute url (http://server.com/controller/action) meanwhile path prints the relative url (/controller/action
).