Rails 7 and Adminkit when I click the icons disappear

28 Views Asked by At

I'm trying to implement Adminkit in Ruby on Rails 7, using feather icons. The problem is that when I click on a link_to tag the icons do not appear again. At the same time this message appears in the console: authors:1 The resource http://localhost:3000/assets/application-e0cf9d8fcb18bf7f909d8d91a5e78499f82ac29523d475bf3a9ab265d5e2b451.css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

When I add data: { turbo: false } the icons reload but I don't know how to solve it without disabling turbo.

application.html.erb

<body>
    <div class="wrapper">
      <%= render partial: 'shared/sidebar' %>

      <div class="main">
        <%= render partial: 'shared/navbar' %>

        <%= yield %>

        <%= render partial: 'shared/footer' %>
      </div>
    </div>   
  </body>

shared/_sidebar.html.erb

<li class="sidebar-item active">
        <%= link_to posts_path, class: 'sidebar-link' do %>
          <i class="align-middle" data-feather="feather"></i> <span class="align-middle">Posts</span>
        <% end %>
      </li>

      <li class="sidebar-item active">
        <%= link_to authors_path, class: 'sidebar-link' do %>
          <i class="align-middle" data-feather="book"></i> <span class="align-middle">Authors</span>
        <% end %>
      </li>
0

There are 0 best solutions below