No commit activity in last 3 years
No release in over 3 years
Basically trying to replicate ActiveSupports to_query method without having to include all of ActiveSupport. Hopefully someone finds this useful.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
~> 0
 Project Readme

Gem Version Build Status

CGI::QueryString

Helper methods for dealing with query strings in ruby.

Basically trying to replicate ActiveSupports to_query method without having to include all of ActiveSupport.

Hopefully someone finds this useful.

TODO: add a deparam method

Installation

Add this line to your application's Gemfile:

gem 'cgi-query_string'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cgi-query_string

Usage

require 'cgi/query_string'

CGI::QueryString.param({
	:a => 1,
	:b => {
		:c => [1,2,3]
	},
	:d => [4,5,6]
})

== "a=1&b%5Bc%5D%5B%5D=1&b%5Bc%5D%5B%5D=2&b%5Bc%5D%5B%5D=3&d%5B%5D=4&d%5B%5D=5&d%5B%5D=6"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/butchmarshall/ruby-cgi-query_string.

License

The gem is available as open source under the terms of the MIT License.