instance method message

Ruby on Rails 8.1.2

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

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

Type at least 2 characters to search.

↑↓ navigate · open · esc close