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
Post a Comment