debugging - On Ruby on Rails, how do we print debug info inside of a controller? -
In PHP, CGI, or ROR view, we can print debug information easily. How about the controller, how can we say, print "Hello World"
(in webpage output) and return to continue with the view, or there the controller can turn it there. Are you You can:
render: text = & Gt; @ Some_object.inspect
but your view will not be provided.
You can also:
Rails.logger.debug ("My Object: # {@ some_object.inspect}")
Run tail on log / development.log to see more output.
The recommeneded path is in this view:
<% = debug (@some_object)%>
Comments
Post a Comment