1

I have seen this question asked in Stack Overflow but I have been unable to understand the answers given. Could someone please rewrite what I have the proper way so that I can just look at it and understand what you've done.

Currently I have this HTML link that opens a lightbox and displays an image.

 <li><a href="images/product/image1.png" data-lightbox="example-set"><i class="fa fa-eye"></i></a></li>

However, since moving it into rails it doesn't work and I am wondering how I would rewrite this so that it does work.

1 Answer 1

1
<%= content_tag :li do %>
   <%= link_to fa_icon("eye"), "images/product/image1.png", data: { lightbox: "example-set" } %>
<% end %>

This is assuming you're using the font-awesome-rails gem, which comes with the fa_icon helper.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.