RailsCasts Pro episodes are now free!

Learn more or hide this

Greg Yardley's Profile

GitHub User: gyardley

Comments by Greg Yardley

Avatar

Include the error messages in your YAML under activemodel, not activerecord.

For my LookupForm form object, I've got some YAML that looks like this:

ruby
en:
  activemodel:
    errors:
      models:
        lookup_form:
          attributes:
            plate:
              blank: "Needs a license plate"
            region:
              blank: "Needs a state"