link_to image_tag with inner text or html in rails
You can use blocks as an alternative to the string interpolation with correct usage html_safe
. For example:
<%= link_to '#' do %>
Lorem Ipsum <%= image_tag('/images/menu-arrow-down.gif') %>
<% end %>
Or a shorter way is
<%= link_to image_tag('image/someimage.png') + "Some text", some_path %>