Studying “Agile Web D.” I stumbled over the validation method
for a database field in the data model. The (german) error message
should contain diacritical characters which have to be html-escaped. I
errors.add( :price, h(" muss grÃ¶sser 0 sein" )) if ((price.nil?) ||
(price < 0.01))
which leads to the error message
undefined method `h’
- How do I get the function h to work in the database model?
- Is this the correct place to do it? Wouldn’t the formatting of the
error message rather have to be located in a view?