Using turbolinks in a Rails link_to

前端 未结 6 1234
臣服心动
臣服心动 2020-11-29 03:14

Just wondering whether there\'s a way to use turbolinks directly in a rails link_to helper, a quick bit of googling didn\'t uncover anything of note, here\'s the type of thi

6条回答
  •  死守一世寂寞
    2020-11-29 03:46

    Or Ruby 1.9+ syntax:

    <%= link_to 'Foo', foo_path(@foo), data: { no_turbolink: true } %>
    

    But I ended up dropping turbolinks in favour of Wiselinks which makes behaviour explicit on all links, plus Wiselinks also supports partial update (eg paging), replace state (doesn't pollute browser history, great for column sorting), form submission (great for search forms), redirects, support for browsers without history API, and more intelligent asset change handling.

提交回复
热议问题