Skip to content

Commit 33acf4b

Browse files
committed
Include Debugbar on development environments
See https://debugbar.dev/ Screenshots of this in action: - ![Bar included at bottom of screen](https://github.com/user-attachments/assets/aea1f59f-cf7e-4e21-9210-f8e4d5b3a54a) - ![Expanded bar, showing SQL queries](https://github.com/user-attachments/assets/0bd3d754-76e4-4075-aaa4-c2b89553f0b8) - ![Requests are tracked](https://github.com/user-attachments/assets/34099245-d658-4cc1-83db-7e6d1c83ca69) There is an option for using websockets for a faster implementation (the polling approach takes a second to update). But this didn't seem to work out of the box for me, unlike the polling approach documented here: https://debugbar.dev/docs/polling-mode/
1 parent 04cc654 commit 33acf4b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/views/layouts/design_system.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<% if user_signed_in? %>
44
<% content_for :head do %>
5+
<%= debugbar_head if defined? Debugbar %>
56
<meta name="govuk:components_gem_version" content="<%= GovukPublishingComponents::VERSION %>">
67
<%= javascript_include_tag "admin/domain-config" %>
78
<%= javascript_include_tag "govuk_publishing_components/load-analytics" %>
@@ -99,4 +100,5 @@
99100
},
100101
],
101102
} %>
103+
<%= debugbar_body(mode: :poll, poll: { url: "http://whitehall-admin.dev.gov.uk", interval: 1000 }) if defined? Debugbar %>
102104
<% end %>

config/initializers/debug_bar.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
return unless (defined? Debugbar) && (Rails.env.development?)
2+
3+
Debugbar.configure do |config|
4+
config.enabled = true
5+
end

0 commit comments

Comments
 (0)