<%= form_for Item.new, url: user_items_url(user), remote: true do |form| %>
Add New Topic
Add Existing Topic
<%= select_tag "category", options_from_collection_for_select(ItemCategory.order("name ASC").all, "id", "name") %>
<%= form.text_field :name %>
<%= form.text_area :desc, class: "description", :rows => 5 %>
<%= form.text_field :link, class: "link" %>
<%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %>
<%= form.hidden_field :map, :value => @map.id %>
<%= form.submit "Add Topic", class: "addTopic", id: "addTopic" %>
<%= select_tag "initem", options_from_collection_for_select(Item.order("name ASC").visibleToUser(user, nil).delete_if{|item| @map.items.include?(item)}, "id", "name"), {:include_blank => true} %>
<%= form.submit "Add Topic", class: "addTopic", id: "addTopic" %>
<% end %>