Lets say I have i variable var witch is a pointer to another variable named user_id.
How do I puts var such that I can see in the console user_id = (whatever the value is)
Reason why I want to do this, is because I want to write a method called print_debug_block, where you give it an array of variables, and it prints in the following format:
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||开发者_如何学C|||||||
var1 = valOfVar1
var2 = valOfVar2
var3 = valOfVar3
etc
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
logger.debug()
outputs to the log.
See http://guides.rubyonrails.org/debugging_rails_applications.html#the-logger
精彩评论