简体   繁体   English

在Rails 4项目中使用MDI图标的最简单方法是什么?

[英]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图标。

  1. How I integrate MDI icons with my Rails code? 如何将MDI图标与Rails代码集成?

  2. What to include in my Gemfile? 我的Gemfile中包含什么?

  3. 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.

相关问题 将静态页面集成到Rails项目中的最简单方法是什么 - What is the easiest way to integrate static pages into Rails project 在Rails 3中最简单的电子邮件通知方式是什么 - what is the easiest way for email notifications in rails 3 同步模型更改的最简单方法是什么? 轨道 - What is the easiest way to synchronise model changes? Rails 什么自动完成jQuery插件最容易用于rails? - What autocomplete jQuery plugins is the easiest to use for rails? 在我的Rails视图上获得像树/树视图一样的控件的最简单方法是什么? - What would be the easiest way to get a tree / treeview like control on my Rails view? 在我的Rails项目中使用yajl-ruby的最佳方法是什么? - What's the best way to use yajl-ruby with my Rails project? 在ActiveResource中使用OAuth的最简单方法是什么? - What's the easiest way to use OAuth with ActiveResource? Rails中查找用户任务最多的项目的最简单方法 - The easiest way in Rails to find the project with the most user tasks 使用Rails 4和postgres查询范围中日期的最简单方法是什么? - What is the easiest way to query for a date in a range using Rails 4 and postgres? 在Rails 4中添加真棒字体的最简单方法是什么 - What's the easiest way to add font-awesome in rails 4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM