Tuesday 15 July 2014

ruby on rails - Font Awesome - getting wrong icon -


I am using Font Awesome in a Rail 3.2.13 app. I successfully added the following icon to the app: icon-search icon-shopping cart and others. But for some reasons when I try to use icon-thumb and icon-thumb-down, they look like icon-thumb-up-alt or icon-thumb-up-alt if I icon-thumb-up Trying to use alt - I do not show any icon on the page.

I use horrible fonts from both Bootstrap and Gems:

  Groups: property gem 'sass-rails',' ~ & gt; 3.2.3 'Gems' coffee-rail ',' ~ & gt; 3.2.1 'Mani' thermbriaser 'gem' font-awesome-rail 'gem' jquery-ui-rails 'mani' low-rail 'gem' Twitter-BootStrap-Rail 'gem' Ugriff ',' & gt; Here is the .css.scss file:  
  * = required bootstrap_and_overrides * = require_self * = require_tree @import "= 1.0.3 'end'   

Font-awesome "; .in-thumb-up {color: green; } .Ine-thumb-down {color: red; }

here is bootstrap_and_overrides.css.less

  @import "twitter / bootstrap / bootstrap"; Body {padding-top: 50px; } @import "Twitter / Bootstrap / Responsive"; // Set the perfect phantom path @ ScienceStrite Path: Asset Path ("Twitter / Bootstrap / Glyphikon-Ardling"); @Convites LightWatch: Property-Path ("Twitter / Bootstrap / Glyphicon-Aldinger-White"); // set Font Awesome (Font Awesome Default. You can deactivate by commenting below the lines) Note: If you use asset_path () here, then your compiled bootrap_and_overrides.css // will not be the proper path I Now we use the full path. @ Fontwebsite path: property-path ("fontawesome-webfont.eot"); @ Font avowashpath: asset-path ("fontawesome-webfont.woff"); @ Font ahompatiti path: asset path ("fontawesome-webfont.ttf"); @ FontAwmsSwig path: asset-path ("font-os-webfont.svg"); // Font Awesome @import "fontawesome";   

There is a button using the icon:

  <% = link_to (content_tag (: i, "",: class => "Icon-thumbs-up")) + (content_tag (: i, "",:, class => "icon-thumb-down")) + "review", root_path ,: class = & gt; "Btn"%>   

Can this be a problem because I have added twitter bootstrap-rails and font-awesome railway gems?

Thanks Steve

It looks like the twitter-bootstrap-ray gem font The latest version is not importing version 3.2.1, I had to keep the font-awesome-rail gem but I updated the gem in the most recent version, 3.2.1.1

now gemfile like this Looks:

  Groups: Assets Mani 'sass-rails',' ~ & gt; 3.2.3 'Gems' coffee-rail ',' ~ & gt; 3.2.1 'Mani' thermbracer 'Mani' Junkie-U-Rail 'Mani' Low-Rail 'Mani' Twitter-BootStrap-Rail 'Mani "Font-Terrible-Rail" Mani' Eugulfyar ','> 1.0 = 3 'End'   

Application css.scss:

  * = Bootstrap and / override are required * = require_self * = require_tree * / @ Import "font-awesome";   

To avoid the possibility of conflicts between twitter-bootstrap-rails and font-awesome gems, I default with the Twitter-BootStrap-Rail Disabled: Font Awesome (Font Awesome is default. You can disable it by commenting below the lines) Note: If you use asset_path () here , Then your compiled bootrap_and_overrides.css // will not be the proper path. I therefore now we use the full path. // @ fontAwesomeEotPath: property-path ("fontawesome-webfont.eot"); // @ fontAwesomeWoffPath: property-path ("Fontawesome-webfont.woff"); // @ fontAwesomeTtfPath: property-path ("fontawesome-webfont.ttf"); // @ fontAwesomeSvgPath: property-path ("fontawesome- Webfont.svg "); // Font Awesome // @ import "fontoos";

No comments:

Post a Comment