rails6 导入js依赖库css样式

If you have upgraded your app from an earlier version of Rails make sure you add the following line:

 

 Rails.application.config.assets.paths << Rails.root.join('node_modules') in config/initializers/assets.rb.

 

This is included by default in the newly generated apps.

Then in 

app/javascripts/packs/application.sass the following should do the job:
@import 'font-awesome/css/font-awesome'; (no ~ and no file extension)

posted on 2020-06-05 13:47  c3tc3tc3t  阅读(315)  评论(0编辑  收藏  举报