Forum: Ruby on Rails displaying query results with no looping

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Roy Kolak (Guest)
on 2007-04-11 05:22
Hello,

Rails Noob here.

ok, I wrote a little query that is doing what it should be doing.
I run the debug() function on the returned results and I get this...

<%= debug(@total)%>


---
- !ruby/object:Association
  attributes:
    recordCount: "633"


My question is how can I display what 'recordCount' is without looping
through this data?
My second question is what am I looking at? Is this thing an object or a
hash? I am leaning towards an object, but this reminds me too much of
PHP and the print_r() function.

very confused,

Roy k
Roy Kolak (Guest)
on 2007-04-11 08:30
I figured it out...

> - !ruby/object:Association
>   attributes:
>     recordCount: "633"

<%= @total[0].recordCount %>


Thread Closed
This topic is locked and can not be replied to.