nice that we can override the error message when a certain type of
validation fails by using :message. i've used this to help the user so
they can better understand why the app is rejecting their input (or
lack of input).. problem: the damn message comes up, but it prepends
the message with the fieldname .humanize'd !! I do not want that.
anybody know how to make it do what i want (just the message)??
thanks in advance and happy railsing (railling?) to all!
I think, you can do this, but not with using validation helpers. I use
the following code (in model/ *.rb file), for example:
.....
protected
def validate
errors.add({}, "The price should be positive.") unless
self.price.nil? || self.price > 0.0
end
.....
I think, you can do this, but not with using validation helpers. I use
the following code (in model/ *.rb file), for example:
.....
protected
def validate
errors.add({}, "The price should be positive.") unless
self.price.nil? || self.price > 0.0
end
.....