I am used to the approach below when displaying a validation message
class Person < ApplicationRecord
validates :bio, length: { maximum: 1000,
too_long: "%{count} characters is the maximum allowed" }
end
However, I just found out that below is also possible. But I could not find any documentation on %<>s format. And what is the use of s found at the end?
too_long: "%<count>s characters is the maximum allowed" }
Can someone explain the difference between these syntaxes? Or provide a documentation link on %<>s
reference:
https://guides.rubyonrails.org/active_record_validations.html#length