diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/url_for.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/url_for.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index d4cd537048..76311c423a 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -18,8 +18,8 @@ module ActionDispatch # of parameters. For example, you've probably had the chance to write code # like this in one of your views: # - # <%= link_to('Click here', :controller => 'users', - # :action => 'new', :message => 'Welcome!') %> + # <%= link_to('Click here', controller: 'users', + # action: 'new', message: 'Welcome!') %> # # => "/users/new?message=Welcome%21" # # link_to, and all other functions that require URL generation functionality, @@ -28,22 +28,22 @@ module ActionDispatch # the same path as the above example by using the following code: # # include UrlFor - # url_for(:controller => 'users', - # :action => 'new', - # :message => 'Welcome!', - # :only_path => true) + # url_for(controller: 'users', + # action: 'new', + # message: 'Welcome!', + # only_path: true) # # => "/users/new?message=Welcome%21" # - # Notice the <tt>:only_path => true</tt> part. This is because UrlFor has no + # Notice the <tt>only_path: true</tt> part. This is because UrlFor has no # information about the website hostname that your Rails app is serving. So if you # want to include the hostname as well, then you must also pass the <tt>:host</tt> # argument: # # include UrlFor - # url_for(:controller => 'users', - # :action => 'new', - # :message => 'Welcome!', - # :host => 'www.example.com') + # url_for(controller: 'users', + # action: 'new', + # message: 'Welcome!', + # host: 'www.example.com') # # => "http://www.example.com/users/new?message=Welcome%21" # # By default, all controllers and views have access to a special version of url_for, @@ -134,13 +134,13 @@ module ActionDispatch # Any other key (<tt>:controller</tt>, <tt>:action</tt>, etc.) given to # +url_for+ is forwarded to the Routes module. # - # url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :port => '8080' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', port: '8080' # # => 'http://somehost.org:8080/tasks/testing' - # url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :anchor => 'ok', :only_path => true + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', anchor: 'ok', only_path: true # # => '/tasks/testing#ok' - # url_for :controller => 'tasks', :action => 'testing', :trailing_slash => true + # url_for controller: 'tasks', action: 'testing', trailing_slash: true # # => 'http://somehost.org/tasks/testing/' - # url_for :controller => 'tasks', :action => 'testing', :host => 'somehost.org', :number => '33' + # url_for controller: 'tasks', action: 'testing', host: 'somehost.org', number: '33' # # => 'http://somehost.org/tasks/testing?number=33' def url_for(options = nil) case options |