Pascal Bestel

Joined

650 Experience
6 Lessons Completed
0 Questions Solved

Activity

Posted in Stimulus Reflex not replacing element?

I have a view that has a search bar and a card deck.

I'm trying to use stimulus reflect to search the card deck and for some reason my card deck is not re-rendering.

Some of my view updated but the majority of it does not?
The @hello updates but the rest does not?

<div class="page-header d-flex flex-row">
    <div class="page-title d-flex flex-grow-1">
        <h1>Wineries</h1>
    </div>
    <div class="search-bar ml-auto">
        <%= bootstrap_form_for '', html: {class: 'search_form no-submit'} do |f| %>
            <%= f.text_field :search_text, hide_label: true, placeholder: "Search", class: 'form-control-lg', append: "<i class='fas fa-search fa-lg'></i>".html_safe,
                             data: {
                                     controller: "catalogue--wineries",
                                     action: "keyup-> catalogue--wineries#search"
                             }
            %>
            <input type="submit" class="sr-only" tabindex="-1">
        <% end %>
    </div>
</div>
<div class="d-flex flex-column">
    <%= @hello %>
    <div class="d-flex flex-row flex-row-reverse mt-2">
        <sub id="winery-count">Showing <%= @count %> of <%= @total %></sub>
    </div>
    <div class="card-deck winery">

        <% @wineries.each do |winery| %>
            <%= render partial: 'app/catalogue/admin/wineries/winery_card', locals: {winery: winery} %>
        <% end %>
    </div>
</div>