Reputation: 5411
I want to convert this into ruby on rails code :
<a href="#"><span>Log out</span><%= image_tag("images/log-out.png") %></a>
When trying this one:
<%= link_to image_tag("images/log-out.png", :border => 0 ), destroy_user_session_path, :method => :delete %>
I'm getting a link on the image. But i also need to add span with text.I tried this but its not working:-
<%= link_to "<span>Log out</span>"+image_tag("images/log-out.png", :border => 0 ), destroy_user_session_path, :method => :delete %>
Upvotes: 0
Views: 529
Reputation: 3506
Try with:
<%= link_to raw("<span>Log out</span>") + image_tag("images/log-out.png", :border => 0 ), destroy_user_session_path, :method => :delete %>
Upvotes: 1