Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6867461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:18:46+00:00 2026-05-27T03:18:46+00:00

In my en.yml translation file, I have: activerecord: errors: template: header: one: 1 error

  • 0

In my en.yml translation file, I have:

activerecord:
  errors: 
    template: 
       header: 
         one: "1 error prohibited this {{model}} from being saved"
         other: "{{count}} errors prohibited this {{model}} from being saved"  

When an activerecord/validation error occurs during logging into my application, the error message:

“1 error prohibited this user session from being saved”

is displayed (where user_session is the model being used). I’d rather have it say something like

“An error has occured to prevent you from logging into your account”.

How do I override the generic error message with my specific one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:18:46+00:00Added an answer on May 27, 2026 at 3:18 am

    I found the routes Rails (2.3.8) follows to translate error messages (with i18n 0.6.0):
    Also, do not forget to change the full_messages format so that it corresponds with your custom messages.

    Here’s an example with model “Horse”, which validates the attribute “name” (cannot be blank).

    In your model(app/models/horse.rb):

    validates_presence_of :name
    

    In your translation file (config/locales/en.yml):

    en:
      activerecord:
        errors:
          models:
            horse:
              attributes:
                name:
                  blank: "Hey, are you the horse with no name?"
          full_messages:
            format: "%{message}"
    

    Below is a link to the RoR-guides page where I found this. There’s also a list of which messages are required for every variant of validation.

    • ruby on rails guides example and explanation
    • Table with all validations and corresponding messages

    The notation and defaults may change with later versions of Rails and/or i18n.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a YML file containing fixtures for a Rails model (Comment) which looks
In my en.yml I have this: en: errors: format: %{message} messages: blank: %{attribute} can't
I have a file called config.yml in my /config folder of my rails application.
I have a file located at [application]/config/routing.yml, when I change something in there, the
This not worked for me when i tried to change error_messages_for messages in translation.yml
I have the following yml file: Contours count: 8 Contours: - Name: MI Count:
how to convert this file to yml? <container xmlns=http://symfony.com/schema/dic/services xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd> <services> <service
I have a twig file and a yml, in which I define the variables
In a separate YML file i have : flags: [<img src=/images/cms_bo/icons/english.png alt=English/>] When i
Say I have a yml file for my rails configuration... settings.yml defaults: &defaults interceptor_email:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.