问题
I can't seem to find an answer that works for me.
The icon shows up as a box:
I'm using:
font-awesome-rails (4.6.2.0)
rails (4.2.3)
I imported font-awesome-rails in my application.scss file using:
@import "font-awesome";
and here is what I wrote for the view:
<i class="quote-left fa fa-quote-left"></i>
I've tried including it before and after bootstrap.
I also tried manually adding the font folder to the pipeline in application.rb
config.assets.paths << Rails.root.join("app", "assets", "fonts")
Clearing the tmp folder didn't seem to do anything either.
I spent way too much time on this, please help :(
回答1:
Try restarting your webserver, after adding @import 'font-awesome.css' to your application.scss.
Also read these, if you haven't yet,
https://github.com/bokmann/font-awesome-rails/issues/130#issuecomment-95308175
https://github.com/bokmann/font-awesome-rails/issues?q=is%3Aissue+is%3Aclosed
回答2:
I solved this issue by explicitly declaring a font-family: FontAwesome;
rule in my stylesheet because a global *
style was overwriting the font-family
attribute for the .fa
class.
来源:https://stackoverflow.com/questions/37092384/font-awesome-icons-not-showing-using-font-awesome-rails-gem