如何通过simple_form使用FontAwesome

这是我的第一篇文章!

我要使用一个字体惊人的图标: <i class="fas fa-star"></i>

以simple_form形式。 <%= f.input :rating,collection: 0..5 %>

做到这一点的最佳方法是什么? a ⭐️ with 'rating' a side 谢谢

baiziye158 回答:如何通过simple_form使用FontAwesome

对我来说,最好的方法是使用wrapper_html:

<%= f.input :rating,wrapper_html: { class: 'fas fa-star' },collection: 0..5 %>

https://stackoverflow.com/questions/54945633/rails-simple-form-input-with-font-awesome

more info on simple_form

本文链接:https://www.f2er.com/2500378.html

大家都在问