Search code examples
ruby-on-railsrubyruby-on-rails-4slim-lang

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?


Solution

  • 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