Other options would be extending Base class or Observer class like http://wiki.rubyonrails.org/rails/pages/HowToStripWhitespaceFromModelFields
On Jan 24, 9:35 am, sohdubom <sohdu...@gmail.com> wrote: > ref. validates_length_of and trimming > > hi. suppose i’m validating the length of a form field and it’s > validating it for a 7 chars long, eg: > validates_length_of :title, :minimum => 7 > > well, so i fill this form field with a 6 chars long word and add an > extra space char in the end, then validation will consider a 7 chars > long word because it doesn’t trimmed or right-trimmed it before > validation > > i could fix it in client-side with js (bad solution) or maybe run a > before filter to trim it on the server side, but is there a better and > nicer way to do it? Can activerecord deal with it with validations or > other thing? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~----------~----~----~----~------~----~------~--~---