diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-04-08 20:58:09 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-04-08 20:58:09 -0700 |
commit | e7671b5b7f941b99b940131f06fb78ad245375d7 (patch) | |
tree | 64bf641bb134266ffcba5eb9d1193856a329e2d5 | |
parent | 05d4ccffceb1089be67d35b0f6c2383a7d1378df (diff) | |
parent | 6f4f499845ad1eb14a0fdc4f495ee33b0c22ed8a (diff) | |
download | rails-e7671b5b7f941b99b940131f06fb78ad245375d7.tar.gz rails-e7671b5b7f941b99b940131f06fb78ad245375d7.tar.bz2 rails-e7671b5b7f941b99b940131f06fb78ad245375d7.zip |
Merge pull request #5784 from rafaelfranca/default_url-3-2
[3-2-stable] Document that default_url_options must return a hash with symbolized keys
-rw-r--r-- | actionpack/test/controller/base_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 2 | ||||
-rw-r--r-- | railties/guides/source/action_controller_overview.textile | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index 145ef12b94..affa9a6add 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -68,7 +68,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 diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index bc45fabf34..734b6f3aef 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -548,7 +548,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 diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile index bc85f07ecc..99a3480e6d 100644 --- a/railties/guides/source/action_controller_overview.textile +++ b/railties/guides/source/action_controller_overview.textile @@ -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 |