Rails左右箭头的访问键?

时间:2013-05-18 13:25:33

标签: ruby-on-rails

rails是否支持:accesskey属性中的左右箭头键?

= link_to "< Previous", @vehicle.previous, :accesskey => "LEFT ARROW"
= link_to "Next >", @vehicle.next, :accesskey => "RIGHT ARROW"

1 个答案:

答案 0 :(得分:2)

这不是轨道责任。可能你需要一些js插件,将关键按键绑定到链接。

如果您想在生成的<a>代码中添加一些属性,请使用:html_options密钥

= link_to "< Previous", @vehicle.previous, :html_options => {:accesskey => "LEFT ARROW"}