.content
  %p
    =params[:ids].split(",").size
    images concernées

  =form_tag images_select_admin_tags_path, :method => "get", :remote => true  do
    =hidden_field_tag :search_type, "image"
    =hidden_field_tag :page, "1"
    
    =hidden_field_tag "ids", params[:ids]


    =text_field_tag :q, params[:q], :placeholder => "Rechercher un tag"
    =submit_tag "filtrer", :class => "btn btn-default", :style => "margin-bottom: 10px;"

  %br
  %br
  =form_tag tag_operations_save_admin_image_files_path, :method => "post", :remote => true  do
    =hidden_field_tag "ids", params[:ids]
    %p
      =radio_button_tag 'operation', 'add', true
      Ajouter ces tags aux images
    %p
      =radio_button_tag 'operation', 'remove'
      Supprimer ces tags des images
    #results
      -params[:search_type] = "image"
      -@ids = params[:ids].split(",")
      -@tags = Tag.joins(:tag_taggables).where(:tag_taggables => {:taggable_id => @ids, :taggable_type => "ImageFile"} ).group(:id)
      =render(:partial => "admin/tags/image_search")
 
  
    =submit_tag "Sauvegarder", :class => "btn btn-default"