Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:15:50+00:00 2026-06-13T03:15:50+00:00

I’m positive this is a dupe, but I couldn’t find the original. Given a

  • 0

I’m positive this is a dupe, but I couldn’t find the original.

Given a GET-style string like foo=bar&x[0]=baz, how can I decode this into a params-like array in a Rails app?


Updated to add: Note that CGI.parse seems to do much less than whatever magic Rails does:

1.9.3p194 :006 > CGI::parse 'foo=bar&x[foo][bar]=baz'
 => {"foo"=>["bar"], "x[foo][bar]"=>["baz"]} 

CGI.parse didn’t unpack the nested objects into a mult-level hash. In Rails, at some level, this is actually examined.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:15:53+00:00Added an answer on June 13, 2026 at 3:15 am

    For nested queries, Rails uses Racks’ parameter parser Rack::Utils.parse_nested_query:

    Rack::Utils.parse_nested_query 'foo=bar&x[foo][bar]=baz'
     => {"foo"=>"bar", "x"=>{"foo"=>{"bar"=>"baz"}}}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had posted this earlier on Stack Overflow, but couldn't get a positive result.
You can convert a negative number to positive like this: int myInt = System.Math.Abs(-5);
So Python has positive and negative infinity: float(inf), float(-inf) This just seems like the
I'm almost positive this has been answered already; however, unable to find it since
I'm positive that this guide existed, but my Google skills seem to be broken
I'm pretty much positive about this, but just to be on the safe side:
I'm 99.9% positive that this isn't possible, but there may be some obscure ecmascript
I use this preg_match condition for matching positive, negative and decimal values /^[0-9,-\.]{1,50}$/ But
I am positive this has probably been answered many many times but I do
This code works on simulator but not on device. I am positive this has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.