更新时间:2023-12-03 13:37:52
我遇到了同样的问题.您需要关闭您的turbolinks.转到人们用来访问该页面的链接,然后在该页面将其关闭.例如:
I had same problem. You need to turn off your turbolinks. Go the link where people are using to access the page and turn it off there. For example:
<%= link_to 'Use', model, class: "btn btn-primary", :"data-no-turbolink" => true %>
:"data-no-turbolink" =>是
:"data-no-turbolink" => true
将为您执行此操作.将JS与Rails结合使用时,这是一个已知的问题.
will do this for you. It's a known problem when combining JS with Rails.