In Rails 3, validators are changed: now you can specify all validators for a specific field once:
so instead write
Rails Style 2.xx
validates_size_of :username, :within => 5..15, :message=> "username size must be between 5 and 15 "
Now I can write
Rails Style 3
validates :username, :length => { :minimum => 5, :maximum => 40 }
But if I add: messge => "bla bla bla" in this last example (Rails 3 style), an error occurs, so the question arises: How to edit a personal model error message to show them in a view?
thank
source
share