繁体   English   中英

Ruby on Rails Twitter引导glyphicons路径问题

[英]Ruby on rails twitter bootstrap glyphicons path problems

我在Twitter项目上使用Twitter Bootstrap并在Ruby项目上添加了适当的宝石等。

一切工作正常,直到我添加了字形图标-按照:

<span class="glyphicon glyphicon-user"></span>

现在我收到这个错误:

http://localhost:3000/assets/twitter-bootstrap-static/twitter/fonts/glyphicons-halflings-regular.ttf - HTTP 404.

我在堆栈溢出时已经读过许多其他类似的问题,但是解决方案似乎不适合我的应用程序。

对于那些有兴趣的人,大多数建议的修复程序都涉及app / assetts / stylesheets / bootstrap_and_overrides.css.less,这是此文件的当前内容:

@import "twitter/bootstrap/bootstrap";

// Set the correct sprite paths
@iconSpritePath: image-url("twitter/bootstrap/glyphicons-halflings.png");
@iconWhiteSpritePath: image-url("twitter/bootstrap/glyphicons-halflings-white.png");

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: font-url("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: font-url("fontawesome-webfont.eot?#iefix");
@fontAwesomeWoffPath: font-url("fontawesome-webfont.woff");
@fontAwesomeTtfPath: font-url("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: font-url("fontawesome-webfont.svg#fontawesomeregular");

// Font Awesome
@import "fontawesome/font-awesome";

// Glyphicons
//@import "twitter/bootstrap/glyphicons.less";

// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation
//
// Example:
// @link-color: #ff0000;

也许此文件中的iconspritepath错误? 我不确定应该是什么?

请帮忙!

我发现了问题。 在默认情况下,似乎在Rails中的ruby中已设置为使用fontawesome字形图标,而不是带有引导程序的默认字形图标。

因此,我只需要使用用于此站点的另一个CSS类:

http://fortawesome.github.io/Font-Awesome/icons/

Fontawesome绝对比默认字形要好,所以我现在使用:

<span class="fa fa-users fa-2x"></span>

为我的人形图标!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM