In PHP, CGI, or in RoR's View, we can easily print out debug information. How about in the Controller, how can we just say, print "hello world" (to the webpage output) and return to continue with the view, or stop the controller right there?
In PHP, CGI, or in RoR's View, we can easily print out debug information. How about in the Controller, how can we just say, print "hello world" (to the webpage output) and return to continue with the view, or stop the controller right there?
In the controller:
render json: @some_object
return
It will show the object as JSON directly in the browser and stop execution. You can use some browser extensions like JSONView for Chrome to prettify the JSON in the browser.