anchor.diff:      searchCourses();
     });
   
  -  // .click(function(){
  -  //   alert('chamou buton element');
  -  //   addCourseInList();
  -  // });
  -
     var course;
     console.log('valor de course = ' + course);
   
  
positive.code:       console.log(data);
        course = data;
        console.log('valor de course = ' + course);
        viewResult(data);
      }).error(function(){
        alert("Falha no Processamento");
      });
    }
  
    function viewResult(data) {
      console.log(data.name);
      $('#search-result').html(data.name + 
        '<button type="button" id="button-element" onClick="addCourseInList()"> Adicionar </button>');
    }
  
  
    function addCourseInList() {
      console.log('valor 3 de course = ' + course);
      $('#courses-list').append(course.name + '<input type="hidden" value="'+course.id+'" name="school_room[course_ids][]" readOnly="true">');
    }
  
  </script>
  
negative.code:     <%= school_room.text_field :name, class: 'form-control' %>
    </div>
  
    <p>Capacidade</p>
    <div class="checkbox-group">
      <%= school_room.number_field :vacancies %>
    </div>
    <br>
  
    <hr>
      <p>Cursos (código)</p>
      <div class="search-elements">
        <input type="text" id="input-search-courses" class="search-input">
      </div>
      <div class="search-elements">
        <button type="button" id="add-course" class="icon-search-submit"> 
          <i class="fa fa-search fa-lg"></i> 
        </button>
      </div>
      <div class="search-elements" id="courses-list" style="margin-left: 30%">
        <p>Cursos Adicionados</p>
        <input type="hidden" value="" name="school_room[course_ids][]" readOnly="true">
      </div>
  
      <div class="" id="search-result">
        
      </div>
  
      <br>
    <hr>
    <p>Categorias</p>
    <div class="checkbox-group">
      <%= school_room.collection_check_boxes(:category_ids,all_categories,:id,:name, include_blank: true)%>
  