Summary from Jordi Banster, John Topley and Jaril:
I. Quick and dirty way:
raise @foo.inspect
in your controller. Or
<% raise @foo.inspect %>
in your view.
II. Proper login to development.log :
logger.debug "@foo == #{@foo.inspect}"
III. Full debugging :
Install the debugger ( gem install ruby-debug ), and then start the development server with the --debugger flag. Then in your code, call the debugger statement.
Inside the debugger request, you have many commands, including p to print the value of the variable.
squadette
source share