【发布时间】:2014-03-24 15:22:40
【问题描述】:
我正在尝试在我的 rails 4 应用程序中使用 bootstrap 3。按照this 教程使用来自this github 页面的bootstrap saas 设置bootstrap 3。
Bootstrap 工作正常,但字形图标没有按预期工作。
某些字形图标根本不显示。例如我厌倦了在我的 application.html.erb 中显示其中一些进行测试:
glyphicon glyphicon-floppy-disk -> <span class="glyphicon glyphicon-floppy-disk"></span>
</br>
glyphicon glyphicon-plus -> <span class="glyphicon glyphicon-plus"></span>
</br>
glyphicon glyphicon-minus -> <span class="glyphicon glyphicon-minus"></span>
图标呈现为this
根本不呈现软盘图标(显示无效字符) 加号和减号不是粗体,而且比 bootstap 网站上显示的要小得多。
我还在 rails 控制台上看到以下消息。
Started GET "/fonts/glyphicons-halflings-regular.woff" for 127.0.0.1 at 2014-02-22 16:29:54 -0800
ActionController::RoutingError (No route matches [GET] "/fonts/glyphicons-halflings-regular.woff"):
Started GET "/fonts/glyphicons-halflings-regular.ttf" for 127.0.0.1 at 2014-02-22 16:29:54 -0800
ActionController::RoutingError (No route matches [GET] "/fonts/glyphicons-halflings-regular.ttf"):
Started GET "/fonts/glyphicons-halflings-regular.svg" for 127.0.0.1 at 2014-02-22 16:29:54 -0800
ActionController::RoutingError (No route matches [GET] "/fonts/glyphicons-halflings-regular.svg"):
非常感谢您对此问题的意见。
谢谢!
【问题讨论】:
-
你看过这个帖子吗:stackoverflow.com/questions/18369036/… ?
-
我确实检查了这一点,并尝试从他的引导站点复制字体文件,但这也没有帮助。由于我使用的是 sass bootstrap,你能告诉我“@font_face..”的更新是否适用于我吗?如果是,我应该更新哪个文件。谢谢!
-
你在哪里复制字体目录?当您在浏览器中访问 /fonts/glyphicons-halflings-regular.woff 时会发生什么?
标签: ruby-on-rails-4 twitter-bootstrap-3 twitter-bootstrap-rails