11175
(-- --)
August 27, 2008, 4:23pm
1
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
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]}}
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
Fred