0

I use

errors.add(:body, 'is a bit short.. ')

which will result in the error message

Body is a bit short

I'd like to add an error to :body but with the result

Explanation is a bit short

Is there a way to change beginning of the error message and still to have be attached to :body?

Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
  • 1
    You could translate your model attribute with normal i18n. Further information can be found on the guides.rubyonrails.org site. Search there for i18n. – Matthias Sep 29 '13 at 14:00
  • That seems like a hack. If your `:body` is really an `Explanation` then perhaps it should be _named_ `:explanation`. – Michael Hampton Sep 29 '13 at 15:12
  • it should, but changing a lot of the code just for a custom error seems a bit much, further more, explanation is only used here and is subject to change – Nick Ginanto Sep 29 '13 at 15:43

0 Answers0