class ActionDispatch::Journey::Formatter
def extract_parameterized_parts(route, options, recall)
def extract_parameterized_parts(route, options, recall) parameterized_parts = recall.merge(options) keys_to_keep = route.parts.reverse_each.drop_while { |part| !(options.key?(part) || route.scope_options.key?(part)) || (options[part].nil? && recall[part].nil?) } | route.required_parts parameterized_parts.delete_if do |bad_key, _| !keys_to_keep.include?(bad_key) end parameterized_parts.each do |k, v| if k == :controller parameterized_parts[k] = v else parameterized_parts[k] = v.to_param end end parameterized_parts.compact! parameterized_parts end