<% if f.object && f.object.send(attribute) %> <% klass = f.object.send(attribute).class %>
<%= link_to f.object.send(attribute) do %> <%= klass.icon %> <%= f.object.send(attribute).name %> <% end %>
<%= link_to_remove_association f do %> close <% end %> <% else %> <% klass = parent.send(attribute.pluralize).build.class.name.downcase %>
<%= f.label attribute, class: 'active' %>
<%= f.select "#{attribute}_id", current_user.send(klass.pluralize) .in_universe(@universe_scope) .sort_by(&:name) .reject { |content| content.class.name == klass && content.id == @content.id } .map { |c| [c.name, c.id] } .compact, include_blank: true %>
<%= link_to_remove_association f do %> close <% end %>
<% end %>