%= form_for @synapse, url: user_synapse_url do |form| %>
Edit Synapse
<% if Item.visibleToUser(user, nil).count > 0 %>
<%= select "node1_id", "node1", Item.order("name ASC").visibleToUser(user, nil).map {|p| [ p.name, p.id ] }, { :selected => @synapse.node1_id } %>
<% end %>
<%= form.select :category, options_for_select(['none', 'both', 'from-to', 'to-from'], @synapse.category) %>
<%= form.text_field :desc, class: "description" %>
<% if Item.visibleToUser(user, nil).count > 0 %>
<%= select "node2_id", "node2", Item.order("name ASC").visibleToUser(user, nil).map {|p| [ p.name, p.id ] }, { :selected => @synapse.node2_id } %>
<% end %>
<%= form.select :permission, options_for_select(['commons', 'public', 'private'], @synapse.permission) %>
<%= form.submit "Update", class: "update" %>
<% end %>