Overriding validation messages

I have the following in my model

validates_numericality_of :lwind_id

When a user submits a non numeric value for the lwind control, the
default
validaiton message is “Lwind is not a number”. I need this to say “Land
Window is not a number”.

I have placed the following in my model

validates_numericality_of :lwind_id, :message => “Land Window is not a
number”

which yields

“Lwind Land Window is not a number”

Thanks in advance,

Dennis Byrne

unknown wrote:

which yields

“Lwind Land Window is not a number”

because your printing out the values of an array, where:

error[0] is ‘Lwind’
and
error[1] is ‘Land Window is not a number’
and
error is both ‘Lwind Land Window is not a number’

make sense?

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