Disable turbolink in a specific Rails page with HAML -


i have issue in specific page of app, fixed when turbolink disabled. know adding data-no-turbolink body attribute fixes that, don't want turbolink disabled everywhere.

so, best solution use content_for in specific view has issue (i'm using haml):

- content_for :body, "data-no-turbolink" 

but doesn't work (the page load content, no error there no data-no-turbolink in body tag, , issue still live.)

i tried this, no success:

application.html.haml:     %body{ yield(:body_attr) if content_for?(:body_attr) }  my_view.html.haml:     - content_for :body_attr, "data-no-turbolink" 

how can add attribute <body> view? thanks.

a little late solve htaidirt issue, else struggling i've had , solved issue following.

layout

%body{ no_turbolink? } 

helper

  def no_turbolink?     if content_for(:no_turbolink)       { data: {no_turbolink: true} }     else       { data: nil }     end   end 

view

content_for :no_turbolink, true 

hope helps, chris.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -