-1

I tried to add tabindex to link to tag in my Ruby application. It's not working. How to add. I am not getting any syntax error. But on clicking tab, it is not focused. I cannot use div tag.

 <%= link_to xxx ,: tabindex =>1 %>
user3263117
  • 407
  • 1
  • 7
  • 12
  • 1
    Syntax error? `: tabindex` to `:tabindex` Or add more details. – iGian Sep 03 '18 at 14:28
  • Possible duplicate of [specifying additional attributes on anchor tag using link\_to in rails](https://stackoverflow.com/questions/27465783/specifying-additional-attributes-on-anchor-tag-using-link-to-in-rails) – Jagdeep Singh Sep 04 '18 at 06:41

1 Answers1

0

Looks like your syntax is wrong

<%= link_to 'link text', '/link/url', tab_index: '3' %>

from... https://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to

Verty00
  • 726
  • 5
  • 16