Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put span within f.submit

This may be simpe but cant seem to get it working. I have the following submit button

<%= f.submit 'Send Message', class: 'btn submit', id: 'validForm' %>

and I want to put an icomoon image within the button

<span class="icon-envelope"></span>

But how do i get the span class within the button.. ?

Thanks

like image 735
Richlewis Avatar asked Mar 03 '14 23:03

Richlewis


1 Answers

Use button_tag and put the span within the button in that way

<%= button_tag(type: 'submit', class: "btn submit", id: 'validForm') do %>
 <span class="icon-envelope"></span> Send Message
<% end %>
like image 138
Rafa Paez Avatar answered Sep 23 '22 09:09

Rafa Paez