ajk4550
ajk4550

Reputation: 741

Font awesome in Ruby on Rails Slim

I am using Font-Awesome in my ruby on rails project and I am also using the Slim html pre-processor. I am having trouble getting font-awesome to work and I know it is just an issue of me being new to Slim

Here is what I am attempting to do in HTML

<a href="#" class="hollow-btn-green">Sign Up <i class="fa fa-arrow-right"></i></a>

In my Slim file, I was thinking it would be something along the lines of this:

a.hollow-btn-green href="#" Sign Up
  i.fa.fa-arrow-right

But that doesn't seem to be working. It just outputs the literal i.fa.fa-arrow-right into the button instead of processing that to the html code.

Any idea's?

Upvotes: 2

Views: 1954

Answers (2)

Amit Sharma
Amit Sharma

Reputation: 3477

You can try this, I hope this will help.

=link_to "#", class: "hollow-btn-green"
  |Sign Up
  i.fa.fa-arrow-right

Upvotes: 0

dimitry_n
dimitry_n

Reputation: 3019

I think the problem is the Sign Up text not being escaped from formatting. Try this:

a.hollow-btn-green href="#"
    |Sign Up 
    i.fa.fa-arrow-right

Upvotes: 6

Related Questions