Erik Hollensbe
4/29/2006 6:13:00 PM
On 2006-04-29 08:10:37 -0700, "Nate Murray" <jashmenn@gmail.com> said:
> Greetings. I am writing a phone call tracking app, so I have a model
> 'calls'. What I want to do is have some reporting about those calls,
> but I'm not sure what the best practice is for something like a report
> as it relates to the MVC pattern. It's not really an ActiveRecord
> because it doesn't have any persistent data. Should I implement a
> Report model object that is created for reporting? Or is this something
> that should be implemented between helpers and views? ( That is to ask,
> should I put the report logic in its own helper module? )
Someone will undoubtedly say I'm wrong, but this is my opinion:
Your view would be the visualization of the report, e.g, tables, charts, etc.
Your model would be the data generated from the processing the
parameters (static and dynamic).
Your controller, if any, would be the parameters that the report would
be generated from.
> If I choose to go the 'report model' route. Am I wrong in assuming that
> I probably shouldn't even start with rails' 'generate' scripts ( as the
> report wouldnt have tradition ties to a database ) ? I would think that
> something like this would best be built from the ground up.
There is no requirement to use activerecord in any part of rails,
although it will make testing tough.
HTH,
-Erik