Append/prepend bootstrap icons with simple_form

前端 未结 2 1252
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 09:53

Twitter Bootstrap icons are pretty deadly seen here.

Look at the bottom right hand corner of that section. See that email with an icon prepended? That is what I want to

2条回答
  •  礼貌的吻别
    2021-01-31 10:01

    It's due to whitespace between the rendered input and span elements. In this case, a line break.

    I am not familiar enough with HAML to tell you how to eliminate the whitespace, but the equivalent ERB would go something like:

    <%= f.input :email, :wrapper => :append do %>
      <%= f.input_field :email %>
    <% end %>
    

提交回复
热议问题