简体   繁体   中英

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

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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