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:
Santiago Pastorino 2012-04-08 20:10:14 -07:00
commit 4c1dcb0537
3 changed files with 4 additions and 4 deletions

@ -45,7 +45,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

@ -566,7 +566,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