<%# Uses rails_bootstrap_form gem. API at: https://github.com/bootstrap-ruby/rails-bootstrap-forms %>
<%= bootstrap_form_for(osc_job) do |f| %>
  <%= f.alert_message "Please fix the errors below." %>

  <%= f.text_field :name, required: true %>
  <%= f.select :batch_host, Servers.map { |key, val| [ "#{key.titleize} (#{val[:pbshost]})", key ] }, { label: "Batch Server:" }, { class: "selectpicker" } %>
  <%= f.select :script_path, @templates.map { |t| [ "#{t.name}: #{t.path}".html_safe, t.path] }, { label: "Template:" }, { class: "selectpicker", id: "templateSelector", onchange: 'console.log(this)', required: true } %>

  <%= f.submit 'Save', class: 'btn btn-primary' %>
  <%= f.button 'Reset', type: :reset, class: 'btn btn-default' %>

  <%= link_to 'Back', osc_jobs_path, class: 'btn btn-default' %>
  <%= link_to 'Show', osc_job, class: 'btn btn-primary' unless osc_job.new_record? %>
<% end %>

<%# Uses rails_bootstrap_form gem. API at: https://github.com/bootstrap-ruby/rails-bootstrap-forms %>
<%= bootstrap_form_for(osc_job) do |f| %>
  <%= f.alert_message "Please fix the errors below." %>

  <%= f.text_field :name, required: true %>
  <%= f.select :batch_host, Servers.map { |key, val| [ "#{key.titleize} (#{val[:pbshost]})", key ] }, { label: "Batch Server:" }, { class: "selectpicker" } %>
  <%= f.select :script_path, @templates.map { |t| [ "#{t.name}: #{t.path}".html_safe, t.path] }, { label: "Template:" }, { class: "selectpicker", id: "templateSelector", onchange: 'console.log(this)', required: true } %>
  <%= link_to '<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> New Template'.html_safe, new_template_path, { class: 'btn btn-default pull-right', title: "Create a new template", 'data-toggle': 'tooltip', role: 'button' } %>

  <%= f.submit 'Save', class: 'btn btn-primary' %>
  <%= f.button 'Reset', type: :reset, class: 'btn btn-default' %>

  <%= link_to 'Back', osc_jobs_path, class: 'btn btn-default' %>
  <%= link_to 'Show', osc_job, class: 'btn btn-primary' unless osc_job.new_record? %>
<% end %>

Add button to create new template on new job page
Add button to create new template on new job page
