AlpineJS with Turbo

Public
Import AlpineJS with Alpine Turbo Drive Adapter for use with Hotwire Turbo
Icons/chart bar
Used 2 times
Created by
M Mark Mead

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/zPds4M"
Template Source

Review the code before running this template on your machine.

if no?("Do you have AlpineJS installed?")
	run "rails app:template LOCATION='https://railsbytes.com/script/X6ksbg'"
end

run "yarn add alpine-turbo-drive-adapter"

inject_into_file 'app/javascript/packs/application.js', before: "import 'alpinejs'" do <<~EOF
import 'alpine-turbo-drive-adapter'
EOF
end
Comments

Sign up or Login to leave a comment.

© 2021 GoRails, LLC