Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap icon in a submit_tag rails form

I have this form:

<%= form_tag(user_pages_path(current_user), :method => "get") do %>
  <%= text_field_tag :update, 'yes', type: "hidden"  %>
  <%= submit_tag "Update list", :class => "btn btn-default" %>
<% end %>

and I would like to include an icon in the button. I'm using bootstrap, so i must include this code:

<i class=" icon-repeat"></i>

¿Any idea about how to include this code in the form button?

like image 843
Fran Martinez Avatar asked Feb 21 '13 09:02

Fran Martinez


1 Answers

You can use button_tag instead of submit_tag:

<%= button_tag(type: "submit", class: "btn btn-default") do %>
    Update list <i class="icon-repeat"></i>
<% end %>
like image 61
gabrielhilal Avatar answered Oct 17 '22 23:10

gabrielhilal