Never tried it, but I am thinking your first option should work if you sanitize the whole '<br />'. As you posted it, it might be getting processed and made useless by Rails. Have you checked the source to see what was the HTML output?
On Sep 21, 2:57 am, Jim Burgess <li...@ruby-forum.com> wrote: > Is it possible to add a line break to the middle of a custom error > message? > > I have tried: > > errors.add(:thesis, "This field is too long." + "<br />" + "You are > using #{field.length} characters out of a permitted #{permitted}.") > > errors.add(:thesis, "This field is too long." + "\n" + "You are using > #{field.length} characters out of a permitted #{permitted}.") > > And all other possible combinations of the above that I could think of, > but nothing works. > > Any help greatly appreciated. > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.