It's getting old rewriting report code for Rails applications. Ya have to create the query, the routes, the action, and the view...(yes, I'm lazy) Is there anything out there that would create a full report in even fewer steps?
Here's what I imagine would be ideal:
You have a Report record that has a name, query code (in Ruby or SQL), and perhaps some report options like so:
Report.create(:name => "With last name 'smith'",
:query => "Person.where( :last_name => 'smith' )")
This would store a record, and you'd dynamically get a route:
method : report_with_last_name_smith_path
http : GET
url : /report_with_last_name_smith
options : {
:controller => 'reports',
:action => 'with_last_name_smith'
}
And the report record would retrieve all columns from the query (which happens to be all columns in the people table in this case), and generate a view with the data like so (pretend this is html):
| First Name | Last Name | Date of Birth | Sex |
| Bob | Smith | 03-13-2000 | Male |
| Lisa | Smith | 03-23-1980 | Female |
| Jack | Smith | 03-13-1975 | Male |
Anyone know of a plugin that helps achieve at least part of this?
By the way, the Ruport gem will likely be incompatible with Rails 3, and to be honest, it's a little unwieldy.