Last active
October 12, 2015 14:27
-
-
Save cliftonlabrum/4040290 to your computer and use it in GitHub Desktop.
Different ways to show debug info in Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the controller: | |
render :text => @some_object.inspect | |
(your view won't be rendered) | |
In the view: | |
<%= debug(@some_object) %> | |
You could also: | |
logger.info "My info message" | |
logger.debug "My debugging message" | |
logger.warn "My warning message" | |
...and run tail on log/development.log to see the output. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment