# Help with complex hash

**URL:** <https://www.ruby-forum.com/t/help-with-complex-hash/147186>\
**Category:** Rails\
**Created:** [August 29, 2008, 6:15am UTC](https://www.ruby-forum.com/t/help-with-complex-hash/147186 "2008-08-29T06:15:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rustam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@rustam](https://www.ruby-forum.com/u/rustam)\
**Post date:** [August 29, 2008, 6:15am UTC](https://www.ruby-forum.com/t/help-with-complex-hash/147186/1 "2008-08-29T06:15:13Z")

</div>

i want to receive some params from html.erb and the hash from the form  
like this

* * *

{“zinfo”=\>{“483”=\>{“onetime”=\>“32”},  
“484”=\>{“onetime”=\>“32”},  
“485”=\>{“onetime”=\>“22”},  
“486”=\>{“onetime”=\>“22”}},  
“commit”=\>“æ±ºå®š”,  
“authenticity\_token”=\>“699b7b0ae36faad5bfe515968fdf83a193ca503c”,  
“id”=\>“235”}

* * *

how can i get this value on the controller site .  
please help me !

---

<div class="post-metadata">

**Author:** ![rustam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@rustam](https://www.ruby-forum.com/u/rustam)\
**Post date:** [August 29, 2008, 8:28am UTC](https://www.ruby-forum.com/t/help-with-complex-hash/147186/2 "2008-08-29T08:28:36Z")

</div>

Rustam M. wrote:

> i want to receive some params from html.erb and the hash from the form  
> like this
> 
> * * *
> 
> {“zinfo”=\>{“483”=\>{“onetime”=\>“32”},  
> “484”=\>{“onetime”=\>“32”},  
> “485”=\>{“onetime”=\>“22”},  
> “486”=\>{“onetime”=\>“22”}},  
> “commit”=\>“æ±ºå®š”,  
> “authenticity\_token”=\>“699b7b0ae36faad5bfe515968fdf83a193ca503c”,  
> “id”=\>“235”}
> 
> * * *
> 
> how can i get this value on the controller site .  
> please help me !

If you want it to pass you nested params then name your elements with  
brackets, i.e.  
id=“484[onetime]”  
GL.  
-=R

---

<div class="post-metadata">

**Author:** ![rustam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@rustam](https://www.ruby-forum.com/u/rustam)\
**Post date:** [August 29, 2008, 10:43am UTC](https://www.ruby-forum.com/t/help-with-complex-hash/147186/3 "2008-08-29T10:43:01Z")

</div>

This blog has a great tutorial about how to create the right params  
hashes:

> **[Parametrised to the max - Space Vatican](https://www.spacevatican.org/2008/7/18/parametrised-to-the-max/)**
>
> If you’ve played with Rails for more that about 3 minutes you’ll know that the params hash can itself contain hashes. If you use form\_for …

Dirk.

On 29 aug, 06:15, Rustam M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
