I'm trying to wrap an 'anchor' tag
around an svg image
using the link_to helper
. The href
of the link is an anchor on the same page and it has to have a class. I followed the documentation's instructions and it works fine without the class. But when I add the class, it gets added to the href
(a href="/?class=test#section-1")
. I need it to render as this: <a href="/section-1" class="logo-inclub">
.
This is the documentation that I'm following:
link_to(url, html_options = {}) do
# name
end
This is my code (I'm using slim for the template):
= link_to(anchor: 'section-1' , class: 'logo-inclub') do
= svg_image("logo_inclub")
Any help would be appreciated. Thanx!!
Your question probably answer itself:
link_to(url, html_options = {}) do
# name
end
So your link should be:
= link_to('/section-1' , class: 'logo-inclub' ) do
= svg_image("logo_inclub")