I am not aware of how many time this question might have propped up and
how many would have answered but googling for this did not satisfy me.
The issue that I am facing in one of my Rails Application is that I am
entering data in to a different database. I am using the following
connection.insert method of the ActiveRecord Base[/b]
model_name.connection.insert(INSERT IN TO
This works fine till the point that no special characters are used. If
the user tries to insert a " ’ "(single quote) or (’ " ') a double
quote the insert fails.
I brushed through the API and found that they use the protected class
method of ‘sanitize_sql_array’ etc.
One possible way is to do a gsub and replace the ’ with /’ but I wanted
to know if there is any method in Ruby or Rails that could sanitize the
text before entering it in to the database