Redirect with multi-dimensional parameter hashes

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

On Aug 27, 5:23 pm, Stefano B. [email protected]
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:
http://www.spacevatican.org/2008/7/18/parametrised-to-the-max

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs