instance method
message
Ruby on Rails 8.1.2
Since v6.1.7.10Signature
message()
Returns the error message.
error = ActiveModel::Error.new(person, :name, :too_short, count: 5) error.message # => "is too short (minimum is 5 characters)"
Source
# File activemodel/lib/active_model/error.rb, line 134
def message
case raw_type
when Symbol
self.class.generate_message(attribute, raw_type, @base, options.except(*CALLBACKS_OPTIONS))
else
raw_type
end
end
Defined in activemodel/lib/active_model/error.rb line 134
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Error