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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Aug-27 16:49 UTC
Re: redirect with multi-dimensional parameter hashes
On Aug 27, 5:23 pm, Stefano Bonomi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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: http://www.spacevatican.org/2008/7/18/parametrised-to-the-max Fred> 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 > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe Matching Threads
- Add hash to serialized column
- syntax error, unexpected '\n', expecting tASSOC
- helper with block compile error
- [ActiveSupport] Patches needing review: re-organization of #to_query methods, preservation of XML/JSON content-type
- start_form_tag not taking url_for options