     field_html = attach_addon(field_html, field)
 
     tags = [label_html, field_html]
-      |> attach_error(form, field)
+    |> attach_error(form, field)
 
     wrapper_class = ["form-group"]
-      |> attach_error_class(form, field)
+    |> attach_error_class(form, field)
+    |> attach_required_class(field)
 
     content_tag(:div, tags, class: Enum.join(wrapper_class, " "))
 

    field_html = attach_addon(field_html, field)

    tags = [field_html]
      |> attach_error(form, field)

    wrapper_class = ["form-group"]
      |> attach_error_class(form, field)

    column = content_tag(:div, tags, class: "col-sm-10")



  defp attach_error_class(wrapper_class, form, field) do
    if form.phoenix_form.errors[field.name] do
      wrapper_class ++ ["has-error"]
    else
      wrapper_class
    end
  end

  defp attach_required_class(wrapper_class, field) do
    if field.required do
      wrapper_class ++ ["required"]
    else
      wrapper_class
    end
