Providing HTML in an error message generated by validation

I have no problem with error generation in the model. It’s nice to see an array of error messages in the model.

I would say you make your own display for it tho…

<%=special_error_messages_for @foo %>

and in the helper, inspect the errors collection that comes from the model and then display appropriate values. If you look at the rails source, it specifically says that error_messages_for is really just an example and you should do your own.

Remember, the model only puts messages in an array. Your view formats them… I don’t consider those view artifacts any more than I consider a total for an invoice to be one… it’s 200.0 in the model, but in the view I use the number_to_currency helper :slight_smile:

Just my opinion tho… feel free to disagree. This is how I’ve handled it before tho.