Build a query string from the keys of the given hash. If only_keys is given (as an array), only the keys indicated will be used to build the query string. The query string will correctly build array parameter values.
Source Code
# File action_controller/routing/route.rb, line 152 def build_query_string(hash, only_keys = nil) elements = [] (only_keys || hash.keys).each do |key| if value = hash[key] elements << value.to_query(key) end end elements.empty? ? '' : "?#{elements.sort * '&'}" end
<code/>and<pre/>for code samples.