How to remove blank values params from query string
I have a search form, with lot of options, Submitted to a route with Get request. URL is something like this: http://localhost:3000/restaurants/search?utf8=%E2%9C%93&city=&cuisine=&number_of_people=&query=hello with lot more params. I want to make it cleaner something like remove all the params which are blank. something like this: (Basically removing all the params which are blank) http://localhost:3000/restaurants/search?query=hello How to do this? One way can be using CGI::parse("foo=bar&bar=foo&hello=hi") Gives you {"foo"=>["bar"], "hello"=>["hi"], "bar"=>["foo"]} First redirect user on a