在 Rails 6 alpha 上安装 https://github.com/twbs/bootstrap-rubygem

2024-01-10

如何安装 bootstrap gem(https://github.com/twbs/bootstrap-rubygem https://github.com/twbs/bootstrap-rubygem)在轨道 6 上?

bootstrap README 要求我们向 application.js 添加内容 但是rails 6似乎在通常的地方没有application.js。

[Rails 6.0.0.alpha]bundle exec rails new noname --edge --database=postgresql --webpacker=react


如果你使用webpacker,你可能想使用bootstrap的npm包

yarn add [email protected] /cdn-cgi/l/email-protection popper.js

and

# app/javascript/packs/application.js
import 'bootstrap/dist/js/bootstrap';

和 stylesheets.scss 内部

@import '~bootstrap/scss/bootstrap';

请在此处查看完整步骤:https://medium.com/@coorasse/goodbye-sprockets-welcome-webpacker-3-0-ff877fb8fa79 https://medium.com/@coorasse/goodbye-sprockets-welcome-webpacker-3-0-ff877fb8fa79

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Rails 6 alpha 上安装 https://github.com/twbs/bootstrap-rubygem 的相关文章

随机推荐