Module: Proxy::ActionController::UrlRewriter
- Defined in:
- lib/proxy/action_controller/url_rewriter.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#rewrite_url_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_controller/url_rewriter.rb', line 4 def self.included(base) base.class_eval { alias_method_chain :rewrite_url, :proxy } end |
Instance Method Details
#rewrite_url_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_controller/url_rewriter.rb', line 12 def rewrite_url_with_proxy() if .is_a?(Hash) [:host] ||= ::ActionController::UrlWriter.[:host] unless ::ActionController::UrlWriter.[:host].blank? .delete(:original_host) end rewrite_url_without_proxy() end |