So, this is the best aproach to solve this issue? (Maybe it works for test but for Production it is not recommended)
Somebody knows if its platform related? (tested in Ubuntu 22.04)
What’s in your application.js and being included in your layout for JS? On a fresh Rails 7 app your link works for me and prompts as expected, here’s what I’m seeing the current include looks like:
It works as expected with the solution mentioned in the Stackoverflow previously commented however my doubt is if thats the rigth solution, this is the line added to application.html.erb:
Im really new to rails so, I want to be sure this is the correct way, i want to know if this issue is related to creating a fresh app in Ubuntu (maybe its not creating the related js file or maybe its “normal” and we must add the “javascript_include_tag “turbo”” line manually and that’s not included in the guide v7.0.3.1).
Just to be clear, I want to know if this is the right way to address this issue, according to the guide:
" we use the data option to set the data-turbo-method and data-turbo-confirm HTML attributes of the “Destroy” link. Both of these attributes hook into Turbo, which is included by default in fresh Rails applications."
Turbo documentation:
"This gem is automatically configured for applications made with Rails 7+ (unless --skip-hotwire is passed to the generator).
"
Have y’all checked if you get any JS error when you load your application?
After initializing my application with Bootstrap I noticed that I was getting an error with the generated code in application.js that was attempting to import Bootstrap from the gem.
After removing the Bootstrap import Turbo began working as expected.
// application.js
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import "@hotwired/turbo-rails"
import "controllers"
// import * as bootstrap from "bootstrap"
Thanks for your contribution
New to Rails 7, i was struggling with that…
Why this information does not belong to the guide or not being in application.html.erb file from the start? This could be discourage new ror users.