Rails 7, Bootstrap 5 & BS icons

Rails 7 (w/ Webpack), Bootstrap 5 & BS icons
Icons/chart bar
Used 29 times
Created by
Z Z N

Usage

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

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

Review the code before running this template on your machine.

def yarn(*packages)
  run("yarn add #{packages.join(" ")}")
end

yarn 'bootstrap', '@popperjs/core', 'bootstrap-icons'

file 'app/javascript/stylesheets/application.scss', <<-CODE
  @import 'bootstrap';
CODE
  
inject_into_file 'app/javascript/application.js' do <<~EOF

  import 'bootstrap';
  import '../stylesheets/application';
  import 'bootstrap-icons/font/bootstrap-icons.css'
  EOF
end
Comments

Sign up or Login to leave a comment.