Kosta Pontidas


60 Experience
0 Lessons Completed
0 Questions Solved


When I use ["Test"] as my rendered Json it works, however when I try to use data from my posts table, it no longer works. I have rechecked syntax and spelling multiple times and am 100% sure its right exactly following this tutorial. Any Ideas? I've posted in stack overflow, no response, attempted dozens of tutorials with different implementation methods, no use. It's really starting to annoy me because it should be quick and easy like your video. I payed and subscribed to your website hoping you could help me. I also posted this question with my code in the communities section.

I followed your tutorial on elastic search/search kick and implementing jquery autocomplete. It works when I use "Test" as the data, however when I try to use my data from posts table, it doesn't work.

So when my posts controller file's autocomplete action looks like this, it works:

  def autocomplete
       render json: ["Test"]

When I change it to this, and add the changes to the post model file, it stops working -

controller file:

    def autocomplete
         render json: Post.search(params[:term], fields: [{title: :text_start}], limit: 10).map(&:title)

post.rb model file:

     searchkick text_start: [:title]

any help is much appreciated. It's really starting to bug me because it should be quick and easy like your tutorial, I have asked multiple questions on stack overflow, no response and researched for days, spent hours doing several different tutorials with different methods. I subscribed to your website hoping you could help. thank you

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.