Strange custom field error message behavior

I’m developing with ruby 1.9.2 and rails 3.2.2. Currently I want to
customize the error message html, to place the error message below a
text area. But what it behaves is two message box around the text area.
Do you know where the problem is? Thanks.

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
errors = instance.error_message
errors_list = “

    ” + errors.map { |e| “
  • #{e}
  • ” }.join +

%(#{html_tag}

Errors

#{errors_list}).html_safe
end Content

Errors

  • can't be blank

Errors

  • can't be blank

Best regards,
Zhi-Qiang L.
[email protected]

OK, I find it. html_tag includes the labels.

On Mar 14, 2012, at 6:32 PM, Zhi-Qiang L. wrote:

Errors

  • can't be

blank


<textarea cols="40" id="script_content" name="script[content]"

rows=“20”>

Errors

  • can't be

blank

Best regards,
Zhi-Qiang L.
[email protected]

Best regards,
Zhi-Qiang L.
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs