Hello,
I''m trying to make a validation that catches special latin chars
that
cause Mysql errors.
Here''s what I''ve been trying so far:
validates_format_of :title, :with=>/\A[^#]/, :message=>''must not
start with
a "#"'', :if => Proc.new {|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
and
the sql error is thrown.
--
View this message in context:
http://www.nabble.com/Validation-on-special-characters-tf4024691.html#a11431779
Sent from the RubyOnRails Users mailing list archive at Nabble.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-/JYPxA39Uh5TLH3MbocFFw@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
-~----------~----~----~----~------~----~------~--~---