mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #5783 from rafaelfranca/default_url_options
Document that default_url_options must return a hash with symbolized keys
This commit is contained in:
commit
4c1dcb0537
3 changed files with 4 additions and 4 deletions
|
@ -45,7 +45,7 @@ class DefaultUrlOptionsController < ActionController::Base
|
|||
render :inline => "<%= #{params[:route]} %>"
|
||||
end
|
||||
|
||||
def default_url_options(options = nil)
|
||||
def default_url_options
|
||||
{ :host => 'www.override.com', :action => 'new', :locale => 'en' }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -566,7 +566,7 @@ class UrlHelperControllerTest < ActionController::TestCase
|
|||
|
||||
def test_named_route_should_show_host_and_path_using_controller_default_url_options
|
||||
class << @controller
|
||||
def default_url_options(options = nil)
|
||||
def default_url_options
|
||||
{:host => 'testtwo.host'}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -152,8 +152,8 @@ You can set global default parameters that will be used when generating URLs wit
|
|||
|
||||
<ruby>
|
||||
class ApplicationController < ActionController::Base
|
||||
# The options parameter is the hash passed in to 'url_for'
|
||||
def default_url_options(options)
|
||||
# This method must return a hash with symbolized keys.
|
||||
def default_url_options
|
||||
{:locale => I18n.locale}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue