2010-02-25 18:05:10 -05:00
|
|
|
module ActionController
|
|
|
|
module UrlFor
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
include ActionDispatch::Routing::UrlFor
|
|
|
|
include ActionController::RackDelegation
|
|
|
|
|
2010-02-26 18:20:41 -05:00
|
|
|
def url_options
|
2010-02-25 18:05:10 -05:00
|
|
|
super.reverse_merge(
|
|
|
|
:host => request.host_with_port,
|
|
|
|
:protocol => request.protocol,
|
|
|
|
:_path_segments => request.symbolized_path_parameters
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def _router
|
|
|
|
raise "In order to use #url_for, you must include the helpers of a particular " \
|
2010-02-26 18:00:33 -05:00
|
|
|
"router. For instance, `include Rails.application.routes.url_helpers"
|
2010-02-25 18:05:10 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|