     field_html = attach_addon(field_html, field)
 
     tags = [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)
 
     column = content_tag(:div, tags, class: "col-sm-10")
 

    data = field.data
    phoenix_opts = if opts[:phoenix_opts], do: opts[:phoenix_opts], else: []

    class = if opts[:class_add], do: opts[:class_add], else: ""

    args = [form.phoenix_form, field.name]
    args = args ++ cond do

    field_html = attach_addon(field_html, field)

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

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

    content_tag(:div, tags, class: Enum.join(wrapper_class, " "))

