pas*_*llo 20 twitter-bootstrap ruby-on-rails-4 twitter-bootstrap-3
我正在尝试从Rails 4项目中的Bootstrap 2迁移到版本3 RC1.
最初我使用了bootstrap-sass gem 2.3.2,一切顺利.
我如何才能将Boostrap 3添加到我的项目中?我找不到任何已转换为SASS的gem,官方文档告诉我将它从LESS编译成CSS.
我对这一切都很陌生,所以我真的很困惑,有什么帮助吗?
更新似乎我最初使用的宝石已经最终更新:https: //github.com/twbs/bootstrap-sass
小智 29
尝试使用https://github.com/anjlab/bootstrap-rails
通过将以下内容添加到您的Gemfile:
gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
:github => 'anjlab/bootstrap-rails',
:branch => '3.0.0'
Run Code Online (Sandbox Code Playgroud)
在您的application.js中添加以下内容:
//= require twitter/bootstrap
Run Code Online (Sandbox Code Playgroud)
在您的application.css中,先添加以下内容:
*= require twitter/bootstrap
Run Code Online (Sandbox Code Playgroud)
小智 17
已经有可以使用的候选版本,添加到GemFile:
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass'
Run Code Online (Sandbox Code Playgroud)
此外,如果您从bootstrap 2升级,那么您必须先删除以前的gem.
我尝试了ShenoudaB建议的解决方案,并让它工作得很好.我需要从以前的版本更改的内容是:
我也注意到一些样式发生了变化.检查新文档并确保您的类名与新名称相匹配.
这就是我所做的一切,它对我有用.祝您的应用程序正常运行!
| 归档时间: |
|
| 查看次数: |
26119 次 |
| 最近记录: |