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
Soluction
Rendered
http://qiita.com/tomomomo1217/items/a5f790c31670587e2d87
I think that should work.. just not 100% about the slim syntax.
link_to
shouldn't have any content when wrapping something as a block -- that is, it should be immediately followed by its url. All the content inside will be wrapped by the<a>
tag output. For non-slim, this would look like