How to use Turbo

I am trying to learn Turbo but I dont know how to use it correctly. I want to use some turbo event but …how?Can I use only Turbo + HTML:

<a href="url" ??????????????? >link text</a>

<script>
  document.addEventListener("turbo:before-visit", function () {
    console.log('TURBO:BEFORE-VISIT')
  })
</script>

Hey Skyler I would love to help out with this but I would need some more context are you using this inside of a Ruby on Rails app? Or your asking if you can use Turbo outside of a Rails app, which that has been done before.

Checkout this section of the Hotwire handbook and the Github for Turbo Rails

1 Like