views:

36

answers:

0

I'm adding full-text search to my Rails site and allowing users to enter double quotes in the search input box. The problem is that the double quotes seem to get filtered out by Mongrel and so I never receive those quotes in the values of the params hash. How do I prevent this from happening? I'm running Rails 2.3.8.

[Edit: added analysis data]

In Firebug I see the post parameter being posted correctly with quotes:

search_criteria "great post"

In the development log, however, the quotes are gone:

Processing PostsController#search (for 127.0.0.1 at 2010-06-18 17:28:45) [POST] Parameters: {"search_criteria"=>"great post", "action"=>"search", "authenticity_token"=>"xUaOc1IAyjQmKn1NGqBpPVaTBmD4ayPq/lUJsqJGCxY=", "controller"=>"posts"}

And when I log the contents and size of params[:search_criteria] in the controller, I get:

search criteria = great post
search criteria size = 10

[Edit: new discovery] This problem described above does not occur when the quoted string is trailed or preceded by another character, e.g. a space.