Rails link_to method with turbolinks disables formatting

I am formatting a video with a gem of video_js. For example, here, as I print my videos:

.row
  - @streams.each do |stream|
    = videojs_rails sources: { mp4: stream.video}, setup: "{}", controls: true, width:"400", class: "col-md-10 col-md-offset-1"

Everything works fine, as expected, if I go to this page with a link. If I create a button c link_toon this page, formatting will be disabled. I need to refresh the page so that it looks as expected. What is wrong with that? Any ideas?

+4
source share
1 answer
  • Remove gem turbolinks from your gemfile
  • Run batch installation
  • In app / views / layouts / application.html.haml set turbolinks to falseas follows:

= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => false

= javascript_include_tag 'application', 'data-turbolinks-track' => false

or delete them.

+1

Source: https://habr.com/ru/post/1615752/


All Articles