A demo Rails 7 app for uploading files with ActiveStorage
-
Ruby 3.2.2
-
Rails 7.0.4.3
-
Database sqlite3
- rails new myapp
- Add gem bootstrap
- Add gem sassc-rails
- Add @import "bootstrap" to app/assets/stylesheets/application.scss
- Optionally you might need to run bin/rails assets:precompile to generate the css
Precompile the bootstrap.min.js that comes with the gem, by adding to config/initializers/assets.rb:
- Rails.application.config.assets.precompile += %w( bootstrap.min.js popper.js )
- pin "popper", to: 'popper.js', preload: true
- pin "bootstrap", to: 'bootstrap.min.js', preload: true
- import "popper"
- import "bootstrap"
- Optionally you might need to run bin/rails assets:precompile to generate the js
- Add modal example