简体   繁体   English

RoR渲染部分Tabindex

[英]RoR Render Partial Tabindex

I have some code 我有一些代码

= link_to "Log In", "" = render :partial => "user/session/new"

I am trying to trigger this not only when Log In is clicked , but when you hit tab on the keyboard ... how do I do this in RoR 我不仅要在单击“登录”时尝试触发此操作,还要在您按键盘上的选项卡时触发此操作……如何在RoR中执行此操作

Thanks for your help 谢谢你的帮助

You can use link_to tag available in Rails for doing the accepted thing that you want on link to you can give the path of the controller. 您可以使用Rails中可用的link_to标记来执行要链接到的可接受的操作,然后可以给出控制器的路径。

eg: 例如:

 <%= link_to "Sign-In", new_user_session_path, :class => "dropdown-toggle", :data => {:toggle=>"dropdown"} %>

which is similar to 这类似于

 <a href="users/sessions/new" class="dropdown-toggle" data-toggle="dropdown">Sign-In</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM