default_url_options does not receive one argument anymore

上级 9f37f335
......@@ -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,7 @@ 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)
def default_url_options
{:locale => I18n.locale}
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册