RatyJs Star Images not showing Rails 6 / Bootstrap 4

118 views Asked by At

My Rails project doesn't show star images with Bootstrap Modal. But it shows all the images with the Bulma.

Application.js

import 'bootstrap'

require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")
require("raty-js")

My modal

<a class="c-secondary" data-toggle="modal" data-target="#<%= o.id %>">Rating</a>
<div class="modal fade" id="<%= o.id %>" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
            <h5 class="modal-title" id="staticBackdropLabel">Rate your order</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            </div>
            <%= form_for Review.new do |f| %>
                <%= f.hidden_field :order_id, value: o.id %>
                <div class="modal-body">
                    <div class="field">

                        <div id="star_<%= o.id %>"></div>
                    </div>
                    <%= f.text_area :review, class: "form-control" %>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn c-btn" data-dismiss="modal">Close</button>
                    <%= f.submit "Add Review", class: "btn btn-danger" %>
                </div>
            <% end %>
        </div>
    </div>
</div>

Modal works. So I can post my review but the images don't show. And I have this problem only with bootstrap.

0

There are 0 answers