<%= f.label :name %>
<%= f.text_field :name, :class => 'form-control' %>
<%= render partial: 'oauth_dropdown', locals: { agent: @agent } %>
<%= f.label :controllers %>
<%= f.select(:controller_ids,
options_for_select(current_user.agents.select(&:can_control_other_agents?).pluck(:name, :id),
@agent.controller_ids),
{}, { multiple: true, size: 5, class: 'select2-linked-tags form-control', data: {url_prefix: '/agents'}}) %>
<%= f.label :control_targets %>
<%= f.select(:control_target_ids,
options_for_select(current_user.agents.map {|s| [s.name, s.id] },
@agent.control_target_ids),
{}, { multiple: true, size: 5, class: 'select2-linked-tags form-control', data: {url_prefix: '/agents'}}) %>
<% 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-linked-tags form-control', data: {url_prefix: '/scenarios'} }) %>
<% end %>
<%= render partial: 'options', locals: { agent: @agent } %>