Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <% @boxes.keys.sort.each do |i| %>
  2. Whole object: <%= @boxes[i].to_json %>
  3. Elements from object: <%= @boxes[i][:ipaddress] %> <%= @boxes[i][:id] %> <%= @boxes[i][:hostname] %>
  4. <% end %>
  5.  
  6. Outputting:
  7.  
  8. Whole object: {"ipaddress":"[removed]","id":"bird.[removed].me","hostname":"bird"}
  9. Elements from object:
  10. Whole object: {"ipaddress":"[removed]","id":"monk.[removed].me","hostname":"monk"}
  11. Elements from object:
  12.  
  13. What's wrong with my syntax that I can't output individual elements?