【问题标题】:Cannot find icons找不到图标
【发布时间】:2013-07-24 05:17:37
【问题描述】:

我正在使用带有 bootstrap-sass gem 的 rails3。

我遇到了一个错误:

ActionController::RoutingError (No route matches [GET] "/img/glyphicons-halflings.png"):

我的 bootstrap_and_overrides.css.scss 是:

@import "bootstrap";
body { padding-top: 60px; }
@import "bootstrap-responsive";

应用程序.js

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require paloma
//= require_tree .

【问题讨论】:

  • No route matches [GET] "/img/glyphicons-halflings.png" 表示你没有在assets glyphicons-halflings.png的img foler中添加任何图片

标签: ruby-on-rails ruby-on-rails-3 twitter-bootstrap twitter-bootstrap-rails


【解决方案1】:

如果您使用gem "twitter-bootstrap-rails",请在bootstrap_and_overrides.css.scss 中尝试此代码

 @import "twitter/bootstrap/bootstrap";
 @import "twitter/bootstrap/responsive";

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

【讨论】:

    猜你喜欢
    • 2018-06-08
    • 2019-01-20
    • 2017-04-05
    • 1970-01-01
    • 1970-01-01
    • 2017-06-29
    • 2012-11-16
    • 2011-03-15
    • 2014-01-05
    相关资源
    最近更新 更多