I am trying to use font-awesome, but upon running , I get the following error(s)
ActionController::RoutingError (No route matches [GET] "/assets/fonts/font-awesome/fontawesome-webfont.woff"):
....
ActionController::RoutingError (No route matches [GET] "/assets/fonts/font-awesome/fontawesome-webfont.ttf"):
....
ActionController::RoutingError (No route matches [GET] "/assets/fonts/font-awesome/fontawesome-webfont.svg"):
In my Gemfile I have:
gem "font-awesome-rails" # https://github.com/bokmann/font-awesome-rails
in my framework_and_overrides.css.scss I have:
// import the CSS framework
@import "bootstrap-sprockets";
@import "bootstrap";
@import "font-awesome";
In my application.css I have:
/*
...
*= require font-awesome
*= require dashboard/framework_and_overrides
....
*/
I added in my application.rb:
config.assets.paths << Rails.root.join("app", "assets", "fonts")
And I run rake assets:clobber , to start on a clean basis .. now way , same errors
Thanks for your enlightenments ...
Remove from application.css:
In your framework_and_overrides.css.scss add the following lines at the bottom:
UPDATE
It turns out you have an issue with the routing of the asset. Rails creates paths to assets depending if they are pre-compiled or not. The safest way to make things work in all cases (both production and development) is to put the routes in font_url ,like this:
Alternatively, you can link an external stylesheet (performance might get worse):