link_to image tag. how to add class to a tag

前端 未结 11 1891
失恋的感觉
失恋的感觉 2020-12-22 20:53

I am using link_to img tag like following

<%= link_to image_tag(\"Search.png\", :border=>0, :class => \'dock-item\'), 
:action => \'search\', :co         


        
11条回答
  •  长情又很酷
    2020-12-22 21:17

    this is my solution:

    <%= link_to root_path do %>
       <%= image_tag "image.jpg", class: "some class here" %>
    <% end %>
    

提交回复
热议问题