All threads / Stimulus Reflex not replacing element?
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Stimulus Reflex not replacing element?

Pascal Bestel asked in Rails

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>
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    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.