Validation on special characters


I'm trying to make a validation that catches special latin chars 

cause Mysql errors.

Here’s what I’ve been trying so far:

validates_format_of :title, :with=>/\A[^#]/, :message=>‘must not start
a “#”’, :if => {|page| page.title && page.title.size > 0 }

validates_exclusion_of :title, :in => ‘Ï€ ≤ ≥ ∫ √ ≈ Ω ∞ ≠∑ ∂ ∆ Ë™ Ëš’,
:message => “Title contains invalid characters”

When I throw these characters into the textfield, they aren’t dectected
the sql error is thrown.

View this message in context:
Sent from the RubyOnRails Users mailing list archive at

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs