ruby - 将引导字形添加到 Rails 中的按钮

标签 ruby html css ruby-on-rails-4 twitter-bootstrap-3

我想将用户字形添加到我当前使用 Rails 4.2.3 和 Ruby 2.2.0 的 Rails 应用程序中的登录输入框

我已经尝试搜索这个很长一段时间了,但还没有找到如何将其添加到 Rails 应用程序中,并且希望我的代码尽可能保持 ruby​​ 状态(如果没有的话,我想 html 就足够了)但我很想学习如何在 Rails 语法中做到这一点。

如有任何帮助,我们将不胜感激。

到目前为止,我的输入字段看起来像这样。

<div class="input-group input-group-lg">
    <%= f.label :email %><br />
    <%= f.email_field :email, autofocus: true %>
</div>

如果可能的话,我还希望字形出现在输入框的左侧,占位符出现在输入框的右侧。

最佳答案

<%= button_tag raw("<i class='srch-control-icon-srch'></i> search"), class: "button round" %>

关于ruby - 将引导字形添加到 Rails 中的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33623428/

相关文章:

python - BeautifulSoup 返回空 html

javascript - 克隆后跳转到 anchor 标签

html - 仅使用 css 将高度设置为宽度的比率

html - 在 CSS 中显示隐藏的网络机器人

javascript - 有没有办法让表格单元格固定在给定高度并启用自动换行?

ruby - 返回 Rails 中公共(public)字符数的函数

ruby - 如何修改ruby中的字符串值?

ruby-on-rails - 在 Ruby on Rails 中,send_file 方法后从服务器删除文件

ruby - Rails has_many 关联导致 "no such column"错误

html - 在中心 CSS 中对齐单个列表项