     fieldset(".inputs", opts) do
       build_fieldset_legend(item[:name]) 
       ol do
-        for inpt <- item[:inputs] do
+        ret = for inpt <- item[:inputs] do
           build_item(inpt, resource, model_name, errors)
         end
       end
     end
+    ret
   end
 
   def build_has_many_fieldset(res, fields, orig_inx, ext_name, field_field_name, model_name, errors) do

      |> Map.put_new(:name, "#{model_name}[#{field_name}]")
      |> Map.put_new(:id, ext_name)
      |> Map.put_new(:value, Map.get(resource, field_name, "") |> escape_value)
      |> Map.to_list
      |> Xain.input
      build_errors(errors)


  def get_label(field_name, opts) do
    cond do
      Map.get(opts, :type) in ["hidden", :hidden] -> 
        :none
      Map.get(opts, :display) -> 
        {:hidden, Map.get(opts, :label, field_name) }
      true -> 
        Map.get opts, :label, field_name
    end
  end

