[英]What is the easiest way to use MDI icons in my Rails 4 Project?
I want to use MDI icons in my new Ruby on Rails 4 project. 我想在新的Ruby on Rails 4项目中使用MDI图标。
How I integrate MDI icons with my Rails code? 如何将MDI图标与Rails代码集成?
What to include in my Gemfile? 我的Gemfile中包含什么?
What to include in my Application CSS? 我的应用程序CSS中应包含什么?
https://materialdesignicons.com/ offer only NPM way. https://materialdesignicons.com/仅提供NPM方式。
It should be SASS or CDN way. 它应该是SASS或CDN方式。 Or, another way what best you prefer?
或者,另一种方式是您最喜欢什么? Thanks.
谢谢。
Add this to your Gemfile 将此添加到您的Gemfile
gem "material_icons"
run 跑
bundle install
and add 并添加
*= require material_icons
to your app/assets/stylesheets/application.css
到您的
app/assets/stylesheets/application.css
After this you can use Material Icons like this: 之后,您可以使用如下所示的“材质”图标:
<%= content_tag(:i, "close", class: "material-icons") %>
More info: https://github.com/Angelmmiguel/material_icons 更多信息: https : //github.com/Angelmmiguel/material_icons
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.