I Rails, to convert a Hash object into a query string or parameter string for use in a url:
opts = {:a => 1, :b => 2}
params = ActionController::Routing::Route.new.build_query_string(opts)
Params => "?a=1&b=2"
Tuesday, March 02, 2010
Subscribe to:
Posts (Atom)