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>
&lt;= debug\_popup&gt;
&lt;% end %&gt;

—You can grab the plugin from subversion at;—

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

&lt;% if RAILS\_ENV == development %&gt;
&lt;= debug\_inline&gt;
&lt;% end %&gt;

Update 12th of May, 2010

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