Add font awesome icons to a form label

font-awesome, ruby, ruby-on-rails-3

Solution

Try something like this (assuming `email` is a field of class `User`):

<%= f.label :email do %>
  <i class="icon-user"></i>
  <%= User.human_attribute_name :email %>
<%- end -%>

Problem

Is it possible to use font awesome icons within a label when creating a form for example. if my form looks like this ``` <%= f.label :email %> <%= f.email_field :email, :autofocus => true %> ``` How would i add the i class to the label? I have tried this ``` <%= f.label :email, :class => 'icon-user' %> <%= f.email_field :email, :autofocus => true %> ``` but this doesn't work?

Original source