I am trying to modify my layout just to add link_to to my drop down list.
previous code:
%li.divider
%li
%a{:href => "#"}
%i.fa.fa-user-profile
Add new user
i edited like this:
%li.divider
%li
= link_to '<i class="fa fa-user-profile"></i> Add new user'.html_safe, new_user_path
And everything looks fine, but fa-user-profile is 0px x 0px and it is invisible. What i done wrong?
Html output:
link_to
has a "blocky" form that accepts custom inner markup:
= link_to new_user_path do
%i.fa.fa-user-profile
Add new user
Regarding element invisibility: the element itself should be filled in by FontAwesome's CSS, using font-family
(on class fa
) and content
(on specific icon class). If you don't have them, it means you don't have the necessary CSS.
How to add it, depends on the way FontAwesome is integrated into your asset pipeline. font-awesome-sass
' README has pretty clear instructions on that, your solution's might differ.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With