tr.nested-fields - if f.object.persisted? td = f.object.try(:item).try(:codigo_descricao_unidade_codigo_da_prefeitura) -else td = f.select :item_do_lote_id, options_from_collection_for_select( \ @itens_do_lote_por_unidades_da_ata, :id, :codigo_descricao_unidade_codigo_da_prefeitura, f.object.try(:item_do_lote_id) \ ), { include_blank: "Selecione" }, class: "form-control s2", disabled: f.object.persisted? = error_for f.object, :item_do_lote_id td - if f.object.new_record? || f.object.pode_ser_deletado? = link_to_remove_association " Remover", f, class: "btn btn-sm btn-danger icone-anular"