我有一个 ruby on rails 应用程序。我使用 bootstrap-sass
gem 并按照以下说明向其添加了 Bootstrap :
https://github.com/twbs/bootstrap-sass
但是,我认为某些 Bootstrap 样式并未导入。例如使用 class=panel
没有做任何事情。另外,当我在浏览器中 View page source
时,我看不到任何这样的行
<link data-turbolinks-track='true' href='/assets/bootstrap.css'>
我的解决方案是将 bootstrap.css
复制到 app/assets/stylesheets
文件夹中。是应该这样做还是我有更好的方法?
谢谢。
最佳答案
对于非 sass 方法:
https://github.com/seyhunak/twitter-bootstrap-rails
我使用这个 gem,它也有一个与之关联的 Railscast,以便在我的 Rails 应用程序中使用 Twitter Bootstrap。
否则要手动配置 Bootstrap ,将 href 更改为 href="/stylesheets/bootstrap.css"应该可以解决问题。确保也包括 jQuery 链接。
关于html - 在 rails 中 Bootstrap ——没有 bootstrap.css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24115338/