我正在尝试传递两个参数,data-no-turbolinks
并且mobile
这有效:
(1) %a{href: "#{test_path}", data: { no: { turbolink: true }}} %span Test
这转化为
<a data-no-turbolink href='/test'> <span>Test</span></a>
现在我需要向这个链接添加一个参数:mobile
以下所有方法均无效!
(1)%a{href: "", mobile: 1, data: { no: { turbolink: true }}}
或
%a{href: "", data: {mobile: 1, no: { turbolink: true }}}
(turbo-link 正确通过,而不是手机)
(2)%span= link_to "Mobile", {mobile: 1, data: { no: { turbolink: true }}}
(3)%span= link_to "Mobile", {'mobile' => 1, 'data-no-turbolink' => true }
(4)%span= link_to "Mobile", url_for('mobile' => 1, 'data-no-turbolink' => true)
(5) %span= link_to "Mobile", data: {mobile: 1, no: {turbolink: true} }