We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7265111 + da0e869 commit da418dcCopy full SHA for da418dc
activemodel/lib/active_model/errors.rb
@@ -378,6 +378,14 @@ def group_by_attribute
378
# If +type+ is a symbol, it will be translated using the appropriate
379
# scope (see +generate_message+).
380
#
381
+ # person.errors.add(:name, :blank)
382
+ # person.errors.messages
383
+ # # => {:name=>["can't be blank"]}
384
+ #
385
+ # person.errors.add(:name, :too_long, { count: 25 })
386
387
+ # # => ["is too long (maximum is 25 characters)"]
388
389
# If +type+ is a proc, it will be called, allowing for things like
390
# <tt>Time.now</tt> to be used within an error.
391
0 commit comments