Skip to content

Commit

Permalink
Merge pull request #25 from nithinbekal/turbo-compatible
Browse files Browse the repository at this point in the history
Persist debugbar content after turbo page load
  • Loading branch information
julienbourdeau committed Mar 30, 2024
2 parents 995c65f + 95591cb commit 7cb781b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions app/helpers/debugbar/tag_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@ def debugbar_javascript(opt = {})
opt[:mode] = 'poll'
end

html = <<-HTML
<div id="__debugbar"></div>
HTML

html += <<-HTML
raw(<<~HTML)
<div id="__debugbar" data-turbo-permanent></div>
<script type="text/javascript">
window._debugbarConfigOptions = #{opt.to_json}
</script>
HTML

html += <<-HTML
<script defer src="#{Debugbar.config.prefix}/assets/script"></script>
HTML

raw html
HTML
end
end

0 comments on commit 7cb781b

Please sign in to comment.