В моем проекте у меня есть регистрационная форма.
Мой HTML выглядит как
    <form method="post" action="/users">
<div style="margin: 0pt; padding: 0pt;">
<input type="hidden" value="lDHrKRC2ENhRKcaoBR4XGfzri/MY09PjqVDvHRtC0D4=" name="authenticity_token"/>
</div>    
<p><label for="login">Login</label>
        <input type="text" size="30" name="user[login]" id="user_login"/></p>
        <p><label for="email">Email</label>
        <input type="text" size="30" name="user[email]" id="user_email"/></p>
        <p><label for="password">Password</label>
        <input type="password" size="30" name="user[password]" id="user_password"/></p>
        <p><label for="password_confirmation">Confirm Password</label>
        <input type="password" size="30" name="user[password_confirmation]" id="user_password_confirmation"/></p>
        <p><input type="submit" value="Sign up" name="commit"/></p>
      </form>
Теперь, генерируя ошибку, отправив пустую форму, мой код выглядит следующим образом:
    <form method="post" action="/users">
<div style="margin: 0pt; padding: 0pt;"><input type="hidden" value="lDHrKRC2ENhRKcaoBR4XGfzri/MY09PjqVDvHRtC0D4=" name="authenticity_token"/>
</div>    
<p><label for="login">Login</label>
        </p><div class="fieldWithErrors"><input type="text" value="hg" size="30" name="user[login]" id="user_login"/></div>
        <p><label for="email">Email</label>
        </p><div class="fieldWithErrors"><input type="text" value="gh" size="30" name="user[email]" id="user_email"/></div>
        <p><label for="password">Password</label>
        </p><div class="fieldWithErrors"><input type="password" value="gh" size="30" name="user[password]" id="user_password"/></div>
        <p><label for="password_confirmation">Confirm Password</label>
        <input type="password" value="gh" size="30" name="user[password_confirmation]" id="user_password_confirmation"/></p>
        <p><input type="submit" value="Sign up" name="commit"/></p>
      </form>
это разрушит мой макет. Существует ли решение, выполняющее
<input type="text" value="gh" size="30" name="user[email]" class="fieldWithErrors" id="user_email"/>
вместо
<div class="fieldWithErrors"><input type="text" value="gh" size="30" name="user[email]" id="user_email"/></div>
?
