.widget .widget-body = simple_form_for(@base_elemento_de_despesa, url: base_elemento_de_despesa_atualizar_matriz_path(@base_elemento_de_despesa), method: :patch) do |f| table.table.table-bordered.table-hover.table-responsive thead tr th width="45%" Subelemento th width="45%" Subelemento da Matriz th width="10%" tbody#sub_elementos_da_matriz = f.fields_for :sub_elementos_de_despesa_com_matriz_vinculada, @base_elemento_de_despesa.sub_elementos_de_despesa_com_matriz_vinculada do |sub_elemento_de_despesa_com_matriz_vinculada| = render 'sub_elemento_de_despesa_com_matriz_vinculada_fields', f: sub_elemento_de_despesa_com_matriz_vinculada tfoot tr td td td.text-center = link_to_add_association ' Adicionar'.html_safe, f, :sub_elementos_de_despesa_com_matriz_vinculada, :"data-association-insertion-node" => "tbody#sub_elementos_da_matriz", :"data-association-insertion-method" => "append", class: 'btn btn-primary btn-sm', id: 'btn-add-sub-elementos-de-despesa' .form-actions = f.submit "Salvar", class: "btn btn-primary" = link_to "Voltar", base_elementos_de_despesa_path(modulo: contexto_atual.class.to_s.downcase, exercicio: contexto_atual.exercicio), class: "btn btn-default" javascript: $(function(){ $('form').on('cocoon:after-insert', function(e, insertedItem) { $('select.s2', insertedItem).select2() }) })