开发者

Ruby on rails Interpolation issue

Am pretty new to ROR. Need help in Rails form validation.

Am using rails 2.3.5

I have a basic validates_presence_of for th开发者_如何学运维e fields in the form.

Now when i don't enter field details, i do get an error, but the error is displayed as:

{{count}} errors prohibited this {{model}} from being saved  
There were problems with the following fields:  
{{attribute}} {{message}}  
{{attribute}} {{message}}

Any help will be highly appreciated.


This error output is related to the internationalisation and translation of error strings in your system.

There may be a mismatch between your version of Rails and the i18n gem that is breaking string interpolations in your locale file e.g. 'en.yml'.

The first thing I would do to try and fix this problem is to update to the latest version of the 2.3.x series of Rails (which is 2.3.9), and then check that your i18n gem is also at the latest version (0.5.0); because those versions of Rails and i18n have been tested together.

Background information

The interpolation syntax "{{foo}}" was deprecated since 0.4.0 version of the i18n gem, and was removed in version 0.5.0.

The Rails codebase mirrored this change in interpolation syntax in version 2.3.9.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜