Rails Debug Bar
Message from 2022
This post is pretty old! Opinions and technical information in it are almost certainly oudated. Commands and configurations will probably not work. Consider the age of the content before putting any of it into practice.
Saw a Django Debug Bar yesterday, decided I wanted to try to build one for Rails. Ridiculously incomplete right now, but it’s not too hard to expand.
From root of your rails app: git submodule add git://github.com/bkerley/railsdebugbar.git vendor/plugins/railsdebugbar
In the ApplicationController or any other controller:
class ApplicationController < ActionController::Base
after_filter ::RailsDebugBar
end
Hacking in additional entries isn’t too hard:
class RailsDebugBar
def self.filter(controller)
…
parts = ["DEBUG",
rails_version,
"#{controller.class.to_s}/#{controller.action_name}.#{controller.request.format}",
controller.response.status,
["Request headers"] + hash_to_array(controller.request.headers),
["Response headers"]+ hash_to_array(controller.response.headers),
# ADD MORE HERE
]