在rails中使用link_to在锚标签上指定其他属性 [英] specifying additional attributes on anchor tag using link_to in rails

查看:30
本文介绍了在rails中使用link_to在锚标签上指定其他属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说我想在rails中输出这样的html:

Let us say I want an output html like this in rails:

<a role="menuitem" tabindex="-1" href="#">Action</a></li>

如何在rails中使用link_to帮助器指定属性(角色和tabIndex).

How can I specify the attribues (role and tabIndex) using link_to helper in rails.

推荐答案

查看应该可以解决问题

这篇关于在rails中使用link_to在锚标签上指定其他属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆