From 0c181b4b70a703436e608c38fc02cf31db7c915c Mon Sep 17 00:00:00 2001 From: Ivan Vanyak Date: Mon, 17 Dec 2012 14:12:24 +1100 Subject: [PATCH] Add script_name option description and example for #url_for options --- actionpack/lib/action_dispatch/routing/url_for.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index 76311c423a..8e19025722 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -130,6 +130,7 @@ module ActionDispatch # * :port - Optionally specify the port to connect to. # * :anchor - An anchor name to be appended to the path. # * :trailing_slash - If true, adds a trailing slash, as in "/archive/2009/" + # * :script_name - Specifies application path relative to domain root. If provided, prepends application path. # # Any other key (:controller, :action, etc.) given to # +url_for+ is forwarded to the Routes module. @@ -142,6 +143,10 @@ module ActionDispatch # # => 'http://somehost.org/tasks/testing/' # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' # # => 'http://somehost.org/tasks/testing?number=33' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp" + # # => 'http://somehost.org/myapp/tasks/testing' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', script_name: "/myapp", only_path: true + # # => '/myapp/tasks/testing' def url_for(options = nil) case options when nil