Hello Gabriele,

Are you sure there is some data to return from the table?  Check that
the find_by_sql call returns nil or has an array.

Why not skip the find_by_sql and use an ActiveRecord calculation
method?  example:

category_counts = MyModelThatUtilizesTables1.count( :all,
        :group => ['category'],
        :order => ['category'])

You'll get back an array to process in your view.  You can add
a :conditions argument too.

Then in your view check category_counts.nil? or category_counts.size
== 0  (can't remember if it returns nil or an empty array)

-Jim


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to