开发者

"puts" method in rails 3

开发者 https://www.devze.com 2023-01-30 05:56 出处:网络
I\'ve been doing some development with rails 3 and I was wondering why c开发者_运维知识库alling the \"puts\" method doesn\'t output to standard out.

I've been doing some development with rails 3 and I was wondering why c开发者_运维知识库alling the "puts" method doesn't output to standard out.

How do I get this back?


Instead of puts, use logger.info:

logger.info @collection.inspect


You can also use the standard ruby way by calling STDOUT << 'your output'. Method put is not a rails speciality, it comes with ruby. If you use rails, you can also rely on the logger object.

0

精彩评论

暂无评论...
验证码 换一张
取 消