       $('#sortable').sortable({ disabled: false })
 
     # Search contacts
-    $.ajax({
-      url: gon.contact_path,
-      data: {
+    $.post(
+      gon.contact_path,
+      {
         search_term: search_term,
         order: 'position'
-      },
-      type: 'post',
-      success: (data) =>
+      }, (data) =>
         @draw_contacts(data['answer'])
-    })
+    )
 
 
   sort: (order) ->
-    $.ajax({
-      url: gon.contact_path,
-      data: {
+    $.post(
+      gon.contact_path,
+      {
         search_term: '',
         order: order
-      },
-      type: 'post',
-      success: (data) =>
+      }, (data) =>
         @draw_contacts(data['answer'])
-    })
+    )
 
 
 


    # Find last position
    position = $('.contact_name').length
    $.ajax({
      url: gon.addnew_path,
      data: {
        name: new_contact,
        position: position
      },
      type: 'post',
      success: (data) =>
        @search_start('')
        $('.answers_box_addnew').val('')
    })


  delete_contact: (contact_id) ->
    $.ajax({
      url: gon.delete_path,
      data: {
        id: contact_id
      },
      type: 'post',
      success: (data) =>
        @search_start('')
    })


  update_list: ->

      id = $(element).parent().parent().attr('id')
      name = $(element).text()

      $.post(
        gon.update_list_path,
        {
          id: id,
          name: name,
          position: i
        }
      )


  update_color: (id, red) ->
    $.post(
      gon.update_color_path,
      {
        id: id,
        red: red
      }, (data) =>
        $('#' + id).attr('class', 'contact_container_' + data["answer"])
    )


  close_settings: () =>
