<%
  suffix ||= nil
  id = 'entity_tag_list'
  id << "_#{suffix}" if suffix
%>

<div class="easy-tag-list-field">
  <p>
    <%= autocomplete_field_tag 'entity[tag_list][]', autocomplete_easy_taggables_path(format: :json), entity.tag_list.map{|tag| { id: tag, value: tag } }, { id: id, preload: true } %>
  </p>
  <p>
    <%= link_to l(:button_save), 'javascript:void(0)', onclick: "$.post('#{save_entity_easy_taggables_path(klass: entity.class.name.underscore, id: entity)}', $(this).closest('.easy-tag-list-field').find('input').serialize())", class: 'button-positive' %>
  </p>
</div>
