Forum: Ruby on Rails displaying query results with no looping

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

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
    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.