Forum: Ruby on Rails wrap 2 error fields on one div

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mikki S. (Guest)
on 2009-04-20 19:10
Hi, help me in my problem plz.

I have a following code:

<%= error_message_on "guestbook", "text" %>
<%= f.label :text, 'Text:' %>
<%= f.text_area :text %>

After validation i get HTML:

<div class="formError">Error.</div>
<div class="fieldWithErrors"><label
for="guestbook_text">Text:</label></div>
<div class="fieldWithErrors">
  <textarea id="guestbook_text" name="guestbook[text]"></textarea>
</div>

How i can get this:

<div class="fieldWithErrors">
  <div class="formError">Error.</div>
  <label for="guestbook_text">Text:</label>
  <textarea id="guestbook_text" name="guestbook[text]"></textarea>
</div>
This topic is locked and can not be replied to.