Search code examples
ruby-on-rails-4link-to

How to write this Rails link_to with a class code?


I'm trying to figure out how to write this in Ruby/Rails format:

<img src="images/home-dashboard.png" class="wow fadeInUp" data-wow-    duration="4s" alt="">

I'm not sure how to handle the data-wow-duration=4s.

Normally I would write the first part as:

  <%= image_tag("home-dashboard.png", class: "wow fadeInUp") %>

But what about the rest? How should the whole thing be written?


Solution

  • you can just write the attribute name within quotes,

      <%= image_tag("home-dashboard.png", class: "wow fadeInUp", "data-wow-duration" => "4s") %>
    

    it is already answered here