[Rails] Re: Question about Rails-formatted query params in URL
Now that I've done a bit more testing, I think this is simply a namespace collision. I think that query parameters and form parameters share a namespace (the request), and it's reasonable to have weird or undefined behavior when there is a collision. It seems like Rails behavior is to handle the form params first, putting them in the 'params' hash, then handle the query params. The Hash class' behavior would dictate a 'last in wins' behavior, which is consistent with what I'm seeing. I found that I don't really have to encode that parameter in the URL, which solves my immediate problem. Thanks! -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Question about Rails-formatted query params in URL
On May 29, 3:04 pm, Brian Hartin wrote: > Hi all, > > I am seeing a behavior for which I can't find documentation. I am > posting a form to a url with query params formatted in the Rails manner: > > /controller/action?foo[bar]=3 # Of course, the brackets are properly > encoded > > When doing this, the actual form fields get lost, e.g. > > params[:foo] # This gives {:bar => 3} > > even though the form has other fields for foo. > so params[:foo] is being populated partially from parameters in the URL, partially from form parameters ? Some of the parameter parsing stuff changed in 2.3.2 so if you are using 2.3.2 would be interesting to see if this is a regression. Fred > Any ideas? > > Thanks so much, > > Brian Hartin > -- > 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Question about Rails-formatted query params in URL
What is shown in the log file for the parameters for the request? You should see data Processing YourController#method ... Parameters: . Colin 2009/5/29 Brian Hartin > > Hi all, > > I am seeing a behavior for which I can't find documentation. I am > posting a form to a url with query params formatted in the Rails manner: > > /controller/action?foo[bar]=3 # Of course, the brackets are properly > encoded > > When doing this, the actual form fields get lost, e.g. > > params[:foo] # This gives {:bar => 3} > > even though the form has other fields for foo. > > Any ideas? > > Thanks so much, > > Brian Hartin > -- > 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---