Paul Johnson
Paul Johnson

Reputation: 1377

"puts" method in rails 3

I've been doing some development with rails 3 and I was wondering why calling the "puts" method doesn't output to standard out.

How do I get this back?

Upvotes: 5

Views: 8337

Answers (2)

fifigyuri
fifigyuri

Reputation: 5899

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.

Upvotes: 2

Brian Rose
Brian Rose

Reputation: 1725

Instead of puts, use logger.info:

logger.info @collection.inspect

Upvotes: 13

Related Questions