<%= form_for(@scenario, :method => @scenario.new_record? ? "POST" : "PUT") do |f| %> <% if @scenario.errors.any? %>

<%= pluralize(@scenario.errors.count, "error") %> prohibited this Scenario from being saved:

<% @scenario.errors.full_messages.each do |msg| %>

<%= msg %>

<% end %>
<% end %>
<%= f.label :name %> <%= f.text_field :name, :class => 'form-control' %>
<%= f.label :agents %> <%= f.select(:agent_ids, options_for_select(current_user.agents.pluck(:name, :id), @scenario.agent_ids), {}, { :multiple => true, :size => 5, :class => 'select2 form-control' }) %>
<%= f.submit "Save Scenario", :class => "btn btn-primary" %>
<% end %>