Skip to content

Instantly share code, notes, and snippets.

@atomaka
Created June 4, 2012 20:34
Show Gist options
  • Save atomaka/2870709 to your computer and use it in GitHub Desktop.
Save atomaka/2870709 to your computer and use it in GitHub Desktop.
@formatted = Hash.new
# controller getting fat.
@printers.each do |printer|
if not @formatted.has_key?(printer.aoplocation.code)
@formatted[printer.aoplocation.code] = Hash.new
end
@formatted[printer.aoplocation.code][printer.computers] = {
'queue' => printer.queue,
'dd' => printer.dropdown,
'ptype' => printer.aopmodel.code
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment