Given the following class definition in ruby:
class Conversation
class Message
include ActiveModel::Validations
attr_accessor :quantity
validates :quantity, :presence => true
end
end
How can you use i18n to customize the error message. For example, the correct search for the conversation class will be
activemodel:
errors:
models:
conversation:
attributes:
quantity:
blank: "Some custom message"
But what is this Message class? I tried:
activemodel:
errors:
models:
conversation:
message:
attributes:
quantity:
blank: "Some custom message"
activemodel:
errors:
models:
message:
attributes:
quantity:
blank: "Some custom message"
activemodel:
errors:
models:
conversation::message:
attributes:
quantity:
blank: "Some custom message"
None of them work. Any ideas or is this a bug with ActiveModel or I18n?
Dave source
share