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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to