Alessandro De Simone
Alessandro De Simone

Reputation: 4215

Rails doesn't expand the variable "count" when displays

I am developing a Rails 2.3.8 app and I stumbled upon a strange form error: in all errors messages in any input forms, the variable count is not expanded. As instance if I fill in the following form with a too long string (> 300 chars, I've set max=300), the form will display the message: "is too long (maximum is {{count}} characters)" instead of: "is too long (maximum is 300 characters)"

- form_for(@event) do |f|
  = f.label :description
  %br
  = f.text_area :description
  =  f.error_message_on :description

Do you have any ideas why this happens ?

many thanks

Upvotes: 1

Views: 272

Answers (2)

mrwade
mrwade

Reputation: 151

I was having the same issue, and installing i18n 0.4.2 solved it for me.

Upvotes: 0

Mihai Toader
Mihai Toader

Reputation: 12243

Redmine had this issue and they fixed it in 1.0.5.

See here for the changes:

http://www.redmine.org/news/49

in the message they say something along these lines:

Among 11 bug fixes, Redmine 1.0.5 solves the incompatibility with the i18n 0.5.0 gem. The appropriate i18n gem version (0.4.2) is now required

so i assume you need to install the 0.4.2 i18n gem :)

Upvotes: 2

Related Questions