-
-
Save kamarcum/01e8ba283ebfb39877f9 to your computer and use it in GitHub Desktop.
rack parsed_nested_query nonsense
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> require 'rack' | |
=> true | |
irb(main):002:0> query = "filter%5Bsubspecialties%5B%5D%5D=Abdominal+Radiology&filter%5Bemployee_type%5D=All" | |
=> "filter%5Bsubspecialties%5B%5D%5D=Abdominal+Radiology&filter%5Bemployee_type%5D=All" | |
irb(main):003:0> Rack::Utils | |
=> Rack::Utils | |
irb(main):005:0> Rack::Utils.parse_nested_query query | |
=> {"filter"=>{"subspecialties"=>[nil], "employee_type"=>"All"}} | |
irb(main):006:0> query2 = "filter%5Bsubspecialties%5D%5B%5D=Abdominal+Radiology&filter%5Bemployee_type%5D=All" => "filter%5Bsubspecialties%5D%5B%5D=Abdominal+Radiology&filter%5Bemployee_type%5D=All" | |
irb(main):007:0> Rack::Utils.parse_nested_query query2 | |
=> {"filter"=>{"subspecialties"=>["Abdominal Radiology"], "employee_type"=>"All"}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had filter[subspecialties[]]
but needed filter[subspecialties][]
🔥