I just installed a new rails 7 application bundled with bootstrap 5 and im working on an AJAX call for a modal. I am using Turbo-Hotwire. Im looking to not directly use the bootstrap button, but one inline with a rails helper.
The older version, before adding data-bs-toggle would look something like this:
<%= link_to new_modal_path, class='btn btn-success', data: { toggle: "modal", target: "#newModal" } do %>
Test Button
<% end %>
--Modal--
<div class="modal fade" id="newModal" tabindex="-1" arial-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
Example content
</div>
</div>
</div>
Im guessing it is in the data-bs: / togglg-bs or something similar? Any thoughts with Bootstrap 5?
Method above does call a button, but links to the page, and does not call the modal.
Bootstrap 5 button call is data-bs-toggle, however i would prefer not to use the boostrap <button>.
Thanks for the help!