按钮图标添加

1.安装font-awesome-rails

Gemfile
1
gem "font-awesome-rails"

bundle install

app/assets/stylesheets/application.scss
1
@import "font-awesome";

重开server

2.将需要换上按钮的地方。写上查找到的图标代码
eg:将helper中的render_job_status(job)

app/helpers/jobs_helper.rb
1
2
3
4
5
6
7
def render_job_status(job)
if job.is_hidden
content_tag(:span, "", :class => "fa fa-lock")
else
content_tag(:span, "", :class => "fa fa-globe")
end
end