link_to image tag. how to add class to a tag

前端 未结 11 1850
失恋的感觉
失恋的感觉 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:08

    You can also try this

  • <%= link_to "", application_welcome_path, class: "navbar-brand metas-logo" %>
  • Where "metas-logo" is a css class with a background image

提交回复
热议问题