Is there equivalent for PHP's print_r in Ruby / Rails?

前端 未结 8 768
鱼传尺愫
鱼传尺愫 2020-12-08 03:17

In PHP you can do:

print_r($var) or vardump($var)

which prints \"human-readible\" information about variable.

Is there equ

8条回答
  •  无人及你
    2020-12-08 03:29

    Check out the guide for debugging rails: http://guides.rubyonrails.com/debugging_rails_applications.html

    hints: script/console is great to try stuff in the context of your app script/server --debugger to start the server with a debugger turned on, you can then use 'debug' in your code to break into an interactive shell

提交回复
热议问题