Module: Proxy::ActionView::UrlHelper
- Defined in:
- lib/proxy/action_view/url_helper.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#url_for_with_proxy(options = {}) ⇒ Object
Adds the default :host option unless already specified.
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/proxy/action_view/url_helper.rb', line 4 def self.included(base) base.class_eval { alias_method_chain :url_for, :proxy } end |
Instance Method Details
#url_for_with_proxy(options = {}) ⇒ Object
Adds the default :host option unless already specified
It will not set the :host option if options
is not a hash or if the ActionController::UrlWriter.default_url_options[:host]
is blank
12 13 14 15 16 17 18 |
# File 'lib/proxy/action_view/url_helper.rb', line 12 def url_for_with_proxy( = {}) if .is_a?(Hash) [:host] ||= ::ActionController::UrlWriter.[:host] unless ::ActionController::UrlWriter.[:host].blank? .delete(:original_host) end url_for_without_proxy() end |