How to determine the value of a controller variable during execution in Ruby on Rails? -


what best way me determine controller variable's value during execution?

for example, there way can insert break in code, , cause value of variable output screen (or log)?

yes. easiest way raise value string. so: raise @foo.to_s

or, can install debugger (gem install ruby-debug), , start development server --debugger flag. then, in code, call debugger instruction.

inside debugger prompt, have many commands, including p print value of variable.

update: here's a bit more ruby-debug.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -