Wednesday, 7 August 2013

How to place an image inside of a link?

How to place an image inside of a link?

I'm trying something really simple, inside a link I want there to be text
and an image.
= link_to 'NVidia Graphics', inventory_url, class: 'lato' do
= image_tag 'list-highlighter.png'
I'd like the output to be something like:
<a href="/inventory">
NVidia Graphics
<img src="list-highlighter.png" />
</a>
How can I achieve this using Slim? My current code causes the website to
crash.
undefined method `stringify_keys' for "http://foobar.com/inventory":String

No comments:

Post a Comment