Hello, I''m having a problem implementing a link_to_remote that passes a customer''s name as a name=>value hash where the name is ''repaired'' and the value is a customer''s name. It''s getting munged though and turns out to be: "repaired"=>"customer_nameABC-CustomerNameInc" Probably something I''m doing. If someone has time to take a look, here''s the link_to_remote: <%= link_to_remote "Previous Page", :url => {:controller => @controller_name, :action => ''step02'', :repaired=>{''customer_name'' => @customer.name} } %> The parameters that turn up as submitted to my step02 action are Parameters: {"action"=>"step02", "repaired"=>"customer_nameABC-CustomerNameInc", "controller"=>"packing"} Grats for your help, Dave {It''s snowing to beat the band here in Vancouver. Love it!) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Look at the Javascript that''s generated from your link_to_remote. You''re trying to pass a Ruby Hash object as in a query string. I don''t think Ruby is figuring out that it''s receiving anything different from a plain old string. You may have to come up with a different solution. Dave Dumaresq-2 wrote:> > > Hello, > > I''m having a problem implementing a link_to_remote that passes a > customer''s name as a name=>value hash where the name is ''repaired'' and > the value is a customer''s name. > > It''s getting munged though and turns out to be: > > "repaired"=>"customer_nameABC-CustomerNameInc" > > Probably something I''m doing. If someone has time to take a look, > here''s the link_to_remote: > > <%= link_to_remote "Previous Page", :url => {:controller => > @controller_name, :action => ''step02'', :repaired=>{''customer_name'' => > @customer.name} } %> > > The parameters that turn up as submitted to my step02 action are > > Parameters: {"action"=>"step02", > "repaired"=>"customer_nameABC-CustomerNameInc", > "controller"=>"packing"} > > Grats for your help, > Dave > {It''s snowing to beat the band here in Vancouver. Love it!) > > > > > >-- View this message in context: http://www.nabble.com/-Rails--hash-parameters-in-link_to_remote-getting-munged-tf2707867.html#a7555614 Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
Yes you''re right. It''s a plain old query string. I''ve worked around it as you suggested. Thanks! -Dave On Nov 26, 10:53 pm, "s.ross" <cwdi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Look at the Javascript that''s generated from your link_to_remote. You''re > trying to pass a Ruby Hash object as in a query string. I don''t think Ruby > is figuring out that it''s receiving anything different from a plain old > string. You may have to come up with a different solution. > > > > Dave Dumaresq-2 wrote: > > > Hello, > > > I''m having a problem implementing a link_to_remote that passes a > > customer''s name as a name=>value hash where the name is ''repaired'' and > > the value is a customer''s name. > > > It''s getting munged though and turns out to be: > > > "repaired"=>"customer_nameABC-CustomerNameInc" > > > Probably something I''m doing. If someone has time to take a look, > > here''s the link_to_remote: > > > <%= link_to_remote "Previous Page", :url => {:controller => > > @controller_name, :action => ''step02'', :repaired=>{''customer_name'' => > > @customer.name} } %> > > > The parameters that turn up as submitted to my step02 action are > > > Parameters: {"action"=>"step02", > > "repaired"=>"customer_nameABC-CustomerNameInc", > > "controller"=>"packing"} > > > Grats for your help, > > Dave > > {It''s snowing to beat the band here in Vancouver. Love it!)-- > View this message in context:http://www.nabble.com/-Rails--hash-parameters-in-link_to_remote-getti... > Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---