class ActionController::Routing::DynamicSegment

Public Instance Methods

interpolation_chunk(value_code = " click to toggle source
# File lib/big_record/routing_ext.rb, line 21
def interpolation_chunk(value_code = "#{local_name}")
  "\#{CGI.escape(#{value_code}.to_s)}"
end
match_extraction(next_capture) click to toggle source
# File lib/big_record/routing_ext.rb, line 25
def match_extraction(next_capture)
  # All non code-related keys (such as :id, :slug) are URI-unescaped as
  # path parameters.
  default_value = default ? default.inspect : nil
  %Q[
    value = if (m = match[#{next_capture}])
      CGI.unescape(m)
    else
      #{default_value}
    end
    params[:#{key}] = value if value
  ]
end