- @fundo_de_investimento.new_record? ? action = :create : action = :update = form_for( @fundo_de_investimento, url: url_for(controller: 'contabilidade/fundos_de_investimento', action: action), html: { class: "form-vertical" }, role: "form" ) do |f| fieldset legend strong = @fundo_de_investimento.new_record? ? 'Cadastrar' : 'Editar' ' Fundo de Investimento da Conta Bancária .form-group .row .col-sm-4 = f.label :nome_do_fundo, "Nome do Fundo de Investimento*", class: "control-label", for: "normal-field" = f.text_field :nome_do_fundo, class: "form-control" , maxlength: 80 = error_for @fundo_de_investimento, :nome_do_fundo .col-sm-4 = f.label :pessoa_id, "Fundo de Investimento*", class: "control-label" = f.select :pessoa_id, options_from_collection_for_select( \ @pessoas, :id, :nome, @fundo_de_investimento.try(:pessoa_id) \ ), { include_blank: "Selecione" }, class: "form-control s2", data: { value: @fundo_de_investimento.try(:pessoa_id) } = error_for @fundo_de_investimento, :pessoa_id .col-sm-4 = f.label :percentual_da_alocacao_de_recurso_id, "Alocação de Recurso*", class: "control-label" = f.select :percentual_da_alocacao_de_recurso_id, options_from_collection_for_select( \ @percentuais_da_alocacao_de_recurso, :id, :tipo_traduzido, @fundo_de_investimento.try(:percentual_da_alocacao_de_recurso_id) \ ), { include_blank: "Selecione" }, class: "form-control s2", data: { value: @fundo_de_investimento.try(:percentual_da_alocacao_de_recurso_id) } = error_for @fundo_de_investimento, :percentual_da_alocacao_de_recurso_id .form-group h6 ' (*) Campos Obrigatórios .form-actions .row .col-sm-12 = f.submit "Salvar", class: "btn btn-primary" = link_to "Cancelar", @fundo_de_investimento.conta_bancaria, class: "btn btn-default"