Sha256: b41e58ad9c8eeb1bf066575a4b7f57cc5cc95b5af219398a2a12b434ccff2876
Contents?: true
Size: 877 Bytes
Versions: 43
Compression:
Stored size: 877 Bytes
Contents
module UrlForFix # TODO (uwe): Can be removed when using EdgeRails or Rails >= 1.3 def url_for(org_options = {}, *parameters_for_method_reference) return super(org_options, *parameters_for_method_reference) if org_options.nil? || org_options.is_a?(String) new_options = {} org_options.each do |param, value| add_option(new_options, param, value) end url = super new_options, *parameters_for_method_reference url = CGI::unescape(url) if url && org_options[:escape] == false url end # Used with AplicationHelper::url_for def add_option(options, param, value) case value when Hash: value.each do |key, v| add_option(options, "#{param}[#{key}]", v) end when Array: value.each do |v| add_option(options, "#{param}[]", v) end else options[param] = value end end end
Version data entries
43 entries across 43 versions & 1 rubygems