# Connect a field with an error

**URL:** <https://www.ruby-forum.com/t/connect-a-field-with-an-error/176068>\
**Category:** Rails\
**Created:** [September 24, 2009, 9:50am UTC](https://www.ruby-forum.com/t/connect-a-field-with-an-error/176068 "2009-09-24T09:50:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stratboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Post date:** [September 24, 2009, 9:50am UTC](https://www.ruby-forum.com/t/connect-a-field-with-an-error/176068/1 "2009-09-24T09:50:29Z")

</div>

Hi, i have this in a my form for registration user

\<% fields\_for “user[location\_attributes]”, @user.location do  
|location\_form| %\>  
\<%= location\_form.text\_field :full\_address %\>  
\<% end %\>

the location is required.

and so if i submit the form without insert the location the instruction:

\<%= error\_messages\_for :user %\>

print: location required.

but in the field there isn’t the div

around the field of the location like the others fields required

how i can connect the error of the location with the field:

thanks.
