将跨度放在 f.submit 中 [英] Put span within f.submit

查看:37
本文介绍了将跨度放在 f.submit 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能很简单,但似乎无法正常工作.我有以下提交按钮

This may be simpe but cant seem to get it working. I have the following submit button

<%= f.submit 'Send Message', class: 'btn submit', id: 'validForm' %>

我想在按钮内放置一个 icomoon 图像

and I want to put an icomoon image within the button

<span class="icon-envelope"></span>

但是我如何获得按钮内的跨度类..?

But how do i get the span class within the button.. ?

谢谢

推荐答案

使用 button_tag 并以这种方式将跨度放在按钮内

Use button_tag and put the span within the button in that way

<%= button_tag(type: 'submit', class: "btn submit", id: 'validForm') do %>
 <span class="icon-envelope"></span> Send Message
<% end %>

这篇关于将跨度放在 f.submit 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆