Ruby on Rails Debugging Techniques

Nice succinct blog on ROR debugging techniques, saving it for future reference.

Ruby on Rails Debugging Techniques.

Add debugging statements to ROR view

<%= debug @object %>
or
<%= debug 'string' %>
or
<%= 'string'.inspect %>

Add debugging statements to ROR controller

logger.debug "The object is #{@object}"
  
RAILS_DEFAULT_LOGGER.debug @object

Add debugging statements to ROR model

logger.debug "The object is #{@object}"

About Pratik Sinha

Linux Nerd, Socialist, Atheist, Adventuristic, Nature Lover, Geeky.

Leave a Reply