Rails Plugin to Help Debug Views

The debug_view_helper plugin was developed to make it easy to add debug information into your views. It was derived from techniques described in HowtoDebugViews and it makes it possible to expose the followng following debug data;

  • Request Parameters
  • Session Variables
  • Flash Variables
  • Assigned Template Variables

Typically you add code such as the following to the bottom of your layout that exposes the debug button in development mode.

<% if RAILS_ENV == 'development' %>
<center>
  <button onclick="show_debug_popup(); return false;">
    Show debug popup
  </button>
</center>
<%= debug_popup %>
<% end %>

-You can grab the plugin from subversion at;-

Update: Added the ability to add inline debug information via the following. Suggestion by John Dell.

<% if RAILS_ENV == 'development' %>
<%= debug_inline %>
<% end %>

Update 12th of May, 2010

The plugin is now moved to GitHub. See the GitHub project page