ActiveRecord display different text for attribute on validation

What is the best way to tell rails to output a different name in the
validation presented to the user than the actual attribute?

I have a field “trade_attached_pdf”
Which AR creates the error message “Trade attached pdf may only be in

But I want the message to read “Attached pdf may only be in pdf format”

I found human_attribute_name in AR.base but is not clear how to
implement. I
have not done much with I18n, is that where I should perhaps be looking


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