<% for attribute in attributes -%> .text_field = form.label :<%= attribute.name %> = form.<%= attribute.field_type %> :<%= attribute.name %> , :class => 'text' <% end -%>