.alert.alert-warning[role="alert" id="alert-content" style="display: none;"] span#alert-message = simple_form_for(@devolucao_de_bem_patrimonial, html: { class: "form-vertical" }, role: "form") do |f| = f.error_notification = f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? - if @devolucao_de_bem_patrimonial.new_record? = f.hidden_field :origem_id, value: @origem.id = f.hidden_field :origem_type, value: @origem.class.name - else = f.hidden_field :origem_id, value: @devolucao_de_bem_patrimonial.origem_id = f.hidden_field :origem_type, value: @devolucao_de_bem_patrimonial.origem_type fieldset legend strong = @devolucao_de_bem_patrimonial.new_record? ? 'Cadastrar' : 'Editar' ' Devolução de Bens .form-inputs .row .col-sm-2 = f.input :data_da_devolucao, label: 'Data', as: :string, wrapper: :calendar_field, input_html: { class: 's2', autocomplete: "off" } .col-sm-2 = f.input :responsavel, label: 'Responsável' .col-sm-3 = f.label :tipo, "Tipo", class: "control-label", for: "normal-field" = f.select :tipo, options_for_select(\ @tipos.collect {|t|[ Patrimonio::DevolucaoDeBemPatrimonial.localizar("tipo", t[0]), t[0] ] }, @devolucao_de_bem_patrimonial.try(:tipo)\ ), {include_blank: 'Selecione'}, class: 'form-control s2', data: { value: @devolucao_de_bem_patrimonial.try(:tipo) } = error_for @devolucao_de_bem_patrimonial, :tipo .form-group .row .col-sm-12 = f.input :observacao, label: 'Observação', as: :text, input_html: { rows: '5' } .form-actions .row .col-sm-12 = f.submit "Salvar", class: "btn btn-primary" - if @devolucao_de_bem_patrimonial.new_record? = link_to "Cancelar", polymorphic_path(@origem), class: "btn btn-default" - else = link_to "Cancelar", patrimonio_devolucao_de_bem_patrimonial_path(@devolucao_de_bem_patrimonial), class: "btn btn-default"