Ruby on Rails – Strange validation errors

Forms in rails let you show error messages when you create or update the records. In certain situations, I came across a weird issue where the error messages on the view were being shown in a strange format.

I expected to see

There were problems with the following fields:
  Name can't be blank

Instead it appeared as

There were problems with the following fields:
{{attribute}} {{message}}

Googling for it made me aware that this kind of issue could arise due to improper version of internationalization gem i18n. I uninstalled my version of i18n gem and installed 0.4.2. Bingo! Problem  solved.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s