Trigger a click with jQuery using link_to of rails 4

后端 未结 2 1606
滥情空心
滥情空心 2020-12-21 06:09

I\'m working on a Rails 4 app. I need to trigger a click in a link using javascript (or jQuery). I have this in my view:

<%= link_to t(\'.fixture\'), fixt         


        
2条回答
  •  萌比男神i
    2020-12-21 07:00

    Though its very late and you have got your problem solved, but here is the actual solution :)

    $('#fixture-link')[0].click();
    

    You missed [0] portion.

提交回复
热议问题