I have an application that generates an ever growing list of stock reports. I find myself some method in a controller creating a connection to the database (postgres in this case), executing a custom sql, using the data returned to create one or more graphs with gruff, and sending them off to be displayed. This puts the creation of a connection to the database, and the actual sql in the controller. I am not sure that this is such a good idea. I am looking for suggestions on a better approach. Should I create a separate class with a method to match each arbitrary sql returning the data from a method call? Should the queries be converted to stored functions which then get called from the controller, or a separate class? Insights would be appreciated. Cheers-- Charles --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---