title: How to return html without layout in Ruby on Rails
body: <p>This is javascript</p>
  
  <pre><code>$('#course_name, #subject').on('input', () =&gt; {
      $.ajax({
          url: '/search_courses_list',
          method: 'get',
          data: {
              course: {name: $('#course_name').val()},
              subject: $('#subject').val()
          },
          success: function (data) {
              $('#course_search_result').html(data)
          }
      })
  }).trigger('input')
  </code></pre>
  
  <p>This is the controller method.</p>
  
  <pre><code>def search_courses_list
  @courses = Course.joins(:segments).where('lower(name) like :str', str: "%#{params["course"]["name"].downcase}%")
  if (params["subject"]!="")
    @courses = @courses.where({segments: {subject_id: params["subject"]}})
  end
  render :search_result, courses: @courses
  end
  
  def search_result
    @courses = courses
  end
  </code></pre>
  
  <p>I tried to use ajax to directly get the Erb generated text as Html strings and insert them directly into the container I want. Is that possible that I get only the Erb file I want without surrounded by the layout?</p>