Rails 2.3.9 I have a form with an input field. If a user enters a phrase surrounded by quotes the value appears in the params object without the quotes. For example: I enter "have fun" in the form. When I submit and inspect params I see: {"q"=>"have fun", "Search"=>"Search", "controller"=>"search", "action"=>"index"} I look at request.query_string and see: &q=%22have+fun%22+&Search=Search Now if I enter the same phrase but have a space in front of it the quotes come through: {"q"=>" \"have fun\"", "Search"=>"Search", "controller"=>"search", "action"=>"index"} &q=+%22have+fun%22&Search=Search Can anyone explain why this is and if there is a workaround? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Rails 2.3.9 > > I have a form with an input field. If a user enters a phrase surrounded > by quotes the value appears in the params object without the quotes. > > For example: > > I enter "have fun" in the form. > > When I submit and inspect params I see: > > {"q"=>"have fun", "Search"=>"Search", "controller"=>"search", > "action"=>"index"} > > I look at request.query_string and see: > &q=%22have+fun%22+&Search=Search > > Now if I enter the same phrase but have a space in front of it the > quotes come through: > > {"q"=>" \"have fun\"", "Search"=>"Search", "controller"=>"search", > "action"=>"index"} > > &q=+%22have+fun%22&Search=Search > > Can anyone explain why this is and if there is a workaround?It''s a problem with the version or rack you''re using... https://github.com/rack/rack/commit/dae12e088592ee69545b5f2f81b87f4959859164 Upgrade to a later version that has the above change in it... -philip -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you On 3 ноя, 22:55, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> > Rails 2.3.9 > > > I have a form with an input field. If a user enters a phrase surrounded > > by quotes the value appears in the params object without the quotes. > > > For example: > > > I enter "have fun" in the form. > > > When I submit and inspect params I see: > > > {"q"=>"have fun", "Search"=>"Search", "controller"=>"search", > > "action"=>"index"} > > > I look at request.query_string and see: > > &q=%22have+fun%22+&Search=Search > > > Now if I enter the same phrase but have a space in front of it the > > quotes come through: > > > {"q"=>" \"have fun\"", "Search"=>"Search", "controller"=>"search", > > "action"=>"index"} > > > &q=+%22have+fun%22&Search=Search > > > Can anyone explain why this is and if there is a workaround? > > It''s a problem with the version or rack you''re using... > > https://github.com/rack/rack/commit/dae12e088592ee69545b5f2f81b87f495... > > Upgrade to a later version that has the above change in it... > > -philip-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.