> I tried: > > errors.add(:thesis, "This field is too long. <%= sanitize('<br />') -%> > You are using #{field.length} characters out of a permitted > #{permitted}.") > > This produced: > "This field is way too long. <%= sanitize('<br />') -%> You are using > 12600 characters out of a permitted 1000." > > In the source code: > Publications This field is sway too long.& l t ;%= sanitize('& l t ;br > /& g t ;') -%& g t ;You are using 12600 characters out of a permitted > 1000. > > I also tried: > errors.add(:thesis, "This field is too long." + <%= sanitize('<br />') > -%> + "You are using #{field.length} characters out of a permitted > #{permitted}.") > > This produced a syntax error: > /applicant.rb:505: syntax error, unexpected '<' > ...s field is way too long." + <%= sanitize('<br />') -%> + "Y...
Trying a few things. But in the meanwhile, you could add 2 separate messages with 'add_to_base': errors.add_to_base 'The publications field is too long.' errors.add_to_base 'You are using...' -- 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.