Permalink
Browse files

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
  • Loading branch information...
2 parents 05d4ccf + 6f4f499 commit e7671b5b7f941b99b940131f06fb78ad245375d7 @spastorino spastorino committed Apr 9, 2012
@@ -68,7 +68,7 @@ def from_view
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
@@ -548,7 +548,7 @@ def test_url_for_nil_returns_current_path
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

0 comments on commit e7671b5

Please sign in to comment.