Error messages always include attribute name

ruby-on-rails, ruby-on-rails-3

Solution

You could use the i18n route to change the display name of the attribute.

config/locales/en.yml:

en:
  activerecord:
    attributes:
      somemodel:
        start_time_time: My Start Time Text  #renamed text
        stylist_services: "" #hidden txet

Problem

I have the following validation error messages coming up when I try to submit a blank form: ``` Start time time Looks like you forgot the appointment start time. Start time time Sorry, we can't understand "" as a time. Start time ymd Please choose a date for the appointment. Start time ymd Sorry, we can't understand "" as a date. Stylist services Please choose at least one service. ``` These messages are for the following attributes: ``` start_time_time start_time_time start_time_ymd start_time_ymd stylist_services ``` I included the attribute names so you could plainly see which part of the error message is the attribute name. How do I remove the attribute names from the error messages?

Original source