My goal is to add a Fontawesome icon inside a submit button using simple_form_for
right now the form is like:
<%= simple_form_for @model, html: {class: "d-flex align-items-end"} do |f| %>
<%= f.input :model, :as => :hidden, :input_html => { :value => model.id } %>
<%= f.input :x, label: false, :input_html => { :value => model.x_attr } %>
<%= f.button :submit, "x", class: "btn btn-secondary" %>
<% end %>
And form is:
Is it possible to add a
<i class="fas fa-cart-arrow-down"></i>
inside that button with simple_form?
Only way i could find is to create the submit button on pure HTML
<%= simple_form_for @model, html: {class: "d-flex align-items-end"} do |f| %>
<%= f.input :model :as => :hidden, :input_html => { :value => model.id } %>
<%= f.input :quantity, label: false, :input_html => { :value => model.x}, wrap_with: { tag: :span} %>
<label>m</label>
<button type="submit" class="btn btn-success btn-card-index-cart" title="Adicionar ao Carrinho">
<i class="fas fa-cart-arrow-down"></i>
</button>
<% end %>
And it works as expected :)