$(document).ready(function(){
  console.log("Connected");
  Search.form_listener();
  Display.list_listener();
})

var Search = (function(){
  return{
    form_listener: function(){
      $("#search_container").on("submit", "#search_form", function(event){
        event.preventDefault();
        var formData = $("input[name='search']").serialize();
        Search.request_search(formData);
      })
    },

    request_search: function(formData){
      var ajaxFind =
        $.ajax({
          type: "POST",
          url: "search/find",
          data: formData,
          dataType: "HTML"
        });

      ajaxFind.done(function(response){
        Search.html_results(response);
      })
    },

    html_results: function(responsePackage){
      $("#results_container").html(responsePackage);
    }
  }
}())

var Display = (function(){
  return {
    list_listener: function(){
      $("#results_container").on("click", "a", function(event){
        event.preventDefault();
        var contact_id = $(this).attr("data-id");

      })
    },
    request_contact: function(id){
      var pacakgeData = {id: id};
      var ajax
    }
  };
}())
$(document).ready(function(){
  console.log("Connected");
  Search.form_listener();
  Display.list_listener();
})

var Search = (function(){
  return{
    form_listener: function(){
      $("#search_container").on("submit", "#search_form", function(event){
        event.preventDefault();
        var formData = $("input[name='search']").serialize();
        Search.request_search(formData);
      })
    },

    request_search: function(formData){
      var ajaxFind =
        $.ajax({
          type: "POST",
          url: "search/find",
          data: formData,
          dataType: "HTML"
        });

      ajaxFind.done(function(response){
        Search.html_results(response);
      })
    },

    html_results: function(responsePackage){
      $("#results_container").html(responsePackage);
    }
  }
}())

var Display = (function(){
  return {
    list_listener: function(){
      $("#results_container").on("click", "a", function(event){
        event.preventDefault();
        var contact_id = $(this).attr("data-id");

      })
    },
    request_contact_template: function(id){
      var packageData = {id: id};
      var ajaxDisplay =
        $.ajax({
          type: "POST",
          url: "search/display",
          data: packageData,
          dataType: "HTML"
        });

      ajaxDisplay.done(function(response){
        console.log(response);
      })
    }
  };
}())
Add Displayy.request_contact_template javascript method to hit #display route with contact ID expecting a template in return