Leahcim Leahcim - 1 year ago 110
YAML Question

Rails: How to display results with Yaml in console

I'm retrieving some records from a database using

user = Users.all
in the console but they are very unreadable.

I know that Yaml will make it more legible but don't know how to convert the results to Yaml.

Answer Source
require 'yaml'
puts user.to_yaml
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download