Sha256: 822b2d9d9ac03dcb4ea39a79dd307c425ae67d0590cf9af3ff110e54454489d8
Contents?: true
Size: 992 Bytes
Versions: 33
Compression:
Stored size: 992 Bytes
Contents
require 'action_dispatch/http/url' module ActionDispatch::Http::URL ## # Enables automatic parameter propagation. # # This will only propagate within the current thread. Child threads will not propagate. # This will not affect other requests in the current session. # # ActionDispatch::Http::URL.propagated_params << :some_param def self.propagated_params @propagated_params ||= [] end def self.path_for(options) if (request = Incline::current_request) propagated_params.each do |k| if request.params.key? k options[:params] ||= {} options[:params][k] = request.params[k] end end end path = options[:script_name].to_s.chomp("/") path << options[:path] if options.key?(:path) add_trailing_slash(path) if options[:trailing_slash] add_params(path, options[:params]) if options.key?(:params) add_anchor(path, options[:anchor]) if options.key?(:anchor) path end end
Version data entries
33 entries across 33 versions & 1 rubygems