rafal.siepak PRO said over 2 years ago on Slim Select with Stimulus :
I am trying to do apply such.code, but it does not work:

def index
    @decks = Deck.all
    respond_to do |format|
      format.html
      format.json {
        @decks = Deck.where("name ILIKE ?", "%#{params[:query]}%")
        render json: @decks.map { |c| { value: c.id, text: c.name } }}
    end
  end