%= form_for @item, url: item_url do |form| %>
Edit Item
<%= select "category", "item_category_id", ItemCategory.all.collect {|p| [ p.name, p.id ] }, { :selected => @item.item_category.id } %>
<%= form.text_field :name %>
<%= form.text_area :desc, class: "description", :rows => 5 %>
<%= form.text_field :link, class: "link" %>
<% if @ingroups.count > 0 %>
<%= select_tag "ingroups", options_from_collection_for_select(@ingroups, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "ingroups", options_from_collection_for_select(@ingroups, "id", "name"), { :multiple => true } %>
<% end %>
<% if @outgroups.count > 0 %>
<%= select_tag "outgroups", options_from_collection_for_select(@outgroups, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "outgroups", options_from_collection_for_select(@outgroups, "id", "name"), { :multiple => true } %>
<% end %>
<% if @inpeople.count > 0 %>
<%= select_tag "inpeople", options_from_collection_for_select(@inpeople, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "inpeople", options_from_collection_for_select(@inpeople, "id", "name"), { :multiple => true } %>
<% end %>
<% if @outpeople.count > 0 %>
<%= select_tag "outpeople", options_from_collection_for_select(@outpeople, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "outpeople", options_from_collection_for_select(@outpeople, "id", "name"), { :multiple => true } %>
<% end %>
<% if @initems1.count > 0 %>
<%= select_tag "initems1", options_from_collection_for_select(@initems1, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "initems1", options_from_collection_for_select(@initems1, "id", "name"), { :multiple => true } %>
<% end %>
<% if @outitems1.count > 0 %>
<%= select_tag "outitems1", options_from_collection_for_select(@outitems1, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "outitems1", options_from_collection_for_select(@outitems1, "id", "name"), { :multiple => true } %>
<% end %>
<% if @initems2.count > 0 %>
<%= select_tag "initems2", options_from_collection_for_select(@initems2, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "initems2", options_from_collection_for_select(@initems2, "id", "name"), { :multiple => true } %>
<% end %>
<% if @outitems2.count > 0 %>
<%= select_tag "outitems2", options_from_collection_for_select(@outitems2, "id", "name"), { :multiple => true } %>
<% else %>
<%= select_tag "outitems2", options_from_collection_for_select(@outitems2, "id", "name"), { :multiple => true } %>
<% end %>
<%= form.submit "Update", class: "update" %>
<% end %>