# Redirect with multi-dimensional parameter hashes

**URL:** <https://www.ruby-forum.com/t/redirect-with-multi-dimensional-parameter-hashes/147028>\
**Category:** Rails\
**Created:** [August 27, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/redirect-with-multi-dimensional-parameter-hashes/147028 "2008-08-27T18:23:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mex23](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@mex23](https://www.ruby-forum.com/u/mex23)\
**Post date:** [August 27, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/redirect-with-multi-dimensional-parameter-hashes/147028/1 "2008-08-27T18:23:13Z")

</div>

Hi,

Is it possible to redirect passing multi dimensional parameters?

I need to send params[:current][:selview] to another action mantaining  
the same data structure

if I try as follows:

redirect\_to :controller=\>“main”,:action=\>“inquiry”,{“current”=\>{  
“selview”=\>params[:current][:selview]}}

I receive “syntax error, unexpected ‘\n’, expecting tASSOC”

the same happens if I try

redirect\_to  
:controller=\>“main”,:action=\>“inquiry”,:current[:selview]=\>params[:current][:selview]}}

Many thanks in advance for your help

Stefano

---

<div class="post-metadata">

**Author:** ![mex23](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@mex23](https://www.ruby-forum.com/u/mex23)\
**Post date:** [August 27, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/redirect-with-multi-dimensional-parameter-hashes/147028/2 "2008-08-27T18:50:25Z")

</div>

On Aug 27, 5:23 pm, Stefano B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> “selview”=\>params[:current][:selview]}}

You need to create the magic parameter names that rails interprets as  
hashes, so in this case try “current[selview]” =\> …  
Also checkout the to\_query method on hash. I’ve also written a blog  
post that covers some of this:

> **[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 …

Fred
