HTML code inside buttons with simple_form
ruby, ruby-on-rails, simple-form, twitter-bootstrap
Solution
Don't use content_tag. The following works:
<%= button_tag(type: 'submit', class: "btn btn-primary") do %>
<i class="icon-ok icon-white"></i> Save
<% end %>
Problem
I'm new to rails, and just found the simple_form gem. I installed it with bootstrap suport, but now I can't get this code to work the way I want it ``` <%= f.button :submit, "<i class='icon-ok icon-white'></i> Save", class: "btn btn-primary" %> ``` I just want to put the icon inside the button, but when I do this, it shows me a button with the text '<i class='icon-ok icon-white'></i> Save' I also tried to do ``` <%= f.button :submit, class: "btn btn-primary" do %><i class="icon-ok icon-white"></i> Save<% end %> ``` But with no success. How can I add some HTML inside the button with simple_form gem?