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}"

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.