all!
I have a little check for the my: username field, which should be between 4 and 30 characters. I wrote a validation: :length => { :within => 4..30, :message => I18n.t('activerecord.errors.range')- I wanted to display one error message for all kinds of errors (it doesn't seem too_long or too_short), but the question is - can I pass both the minimum and maximum values ββin the translation in order to have something like: Username must be between 4 and 30 characters. I currently have: range: "should be between %{count} and %{count} characters"which obviously does not work (did this just for verification).
Is it possible to capture these values ββfrom a range?
Thanks everyone for the advice!
source
share