<% if @agent.new_record? %>
<%= f.label :type %>
<%= f.select :type, options_for_select(Agent.types.map(&:to_s).sort.map {|type| [type.gsub(/^.*::/, ''), type] }, @agent.type), {}, :class => 'select2 form-control' %>
<% end %>
<%= f.label :name %>
<%= f.text_field :name, :class => 'form-control' %>
<% if current_user.scenario_count > 0 %>
<%= f.label :scenarios %>
<%= f.select(:scenario_ids,
options_for_select(current_user.scenarios.pluck(:name, :id), @agent.scenario_ids),
{}, { :multiple => true, :size => 5, :class => 'select2 form-control' }) %>
<% end %>