按钮图标添加 Posted on 2017-01-11 19:13 1.安装font-awesome-rails Gemfile1gem "font-awesome-rails" bundle install app/assets/stylesheets/application.scss1@import "font-awesome"; 重开server 2.将需要换上按钮的地方。写上查找到的图标代码eg:将helper中的render_job_status(job) app/helpers/jobs_helper.rb1234567def render_job_status(job) if job.is_hidden content_tag(:span, "", :class => "fa fa-lock") else content_tag(:span, "", :class => "fa fa-globe") endend