I have a pretty straight-forward Ruport setup in my Rails app, where the Ruport controller is passed a Report::Data::Table
instance:
class Reporter < Ruport::Controller
stage :headline, :data, :footer
required_option :report
def setup
report_klass = options.report.report_model
report_klass ||= Report
self.data = report_klass.send(:report_table_by_sql, options.report.query)
end
end
The Data::Table
instance that is stored in data uses Ruport::Data::Table
as its delegated controller when asked to render, so that's what gets called when I later call
output << data.to_html
How can I tell data to delegate its rendering methods to the Reporter class, so all my hook overrides can live in one place?