tr.nested-fields - if @liquidacao.fatura? td = f.input :numero_da_fatura, input_html: { class: 'numero_da_fatura' } - else td = f.input :nota_fiscal_numero, label: 'No da Nota', input_html: { class: 'numero_da_nota' } td = f.input :valor, label: 'Valor da Nota', as: :string, input_html: { class: 'valor', data: { autonumeric: true, 'a-sep'=> '.', 'a-dec'=>',', 'a-sign'=> 'R$ ', 'v-min'=> '0.00', 'v-max'=> '9999999999.99' } } = f.input :liquidacao_mae_id, as: :hidden, input_html: { value: @liquidacao.id } = f.input :precisa_resgatar_valores_da_mae, as: :hidden, input_html: { value: true } = f.input :id, as: :hidden td.text-center = link_to_remove_association 'Remover', f, class: 'btn btn-sm btn-danger icone-anular' javascript: $(document).ready(function(){ $("abbr").remove(); }) $('form').submit(function(){ var form = $(this); $('input').each(function(i){ var self = $(this); try{ var v = self.autoNumeric('get'); self.autoNumeric('destroy'); self.val(v); }catch(err){ console.log("Not an autonumeric field: " + self.attr("name")); } }); return true; });