Open vfonic opened 3 years ago
@vfonic sorry for the late response currently it's not possibleto add a general error message for all the models
@vfonic @CristiRazvi
It works fine:
en:
errors:
messages:
invalid_enum: "can't be %{value}. Valid values are: %{valid_values}"
I also found that the default
option provided to self.errors.add is actually ignored. Recent ActiveModel
expects the parameter to be called message instead. I'm not sure if this was always the case, or it was changed in a past version. Or maybe I misunderstood the default
parameter, and it's for something else. :thinking:
I just found this gem. It's exactly what I need! Thank you!
I have several models that have pretty-much the same enum. I'd like to have a single error message for all of these enums.
Is it possible for me to add an entry like this to my
config/locales/en.yml
:I tried this and it doesn't work.