# Acts\_as\_reportable

**URL:** <https://www.ruby-forum.com/t/acts-as-reportable/129232>\
**Category:** Rails\
**Created:** [February 15, 2008, 5:23pm UTC](https://www.ruby-forum.com/t/acts-as-reportable/129232 "2008-02-15T17:23:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [February 15, 2008, 5:23pm UTC](https://www.ruby-forum.com/t/acts-as-reportable/129232/1 "2008-02-15T17:23:11Z")

</div>

Hi,

I posted this on the Ruby Reports forum as well, but this may be more  
of a Rails How-To…

I’m using acts\_as\_reportable to generate a simple html table. I am  
using a form for the user to select the model of which they want the  
table, or tables for.

In my controller, I do this to generate the report:  
@models.each { |m|  
@totals = m.report\_table(:all,:conditions  
=\>[“enterdate \>= ? AND enterdate \<= ?”,@start,@end]).to\_html

}

@models contains all the check boxes that were selected in the form.  
The problem is that when I try this, I get:  
undefined method `report\_table’ for “MyModel”:String

MyModel is the name of my model, but it is being treated as a string.  
Is there a way to do this?

Thanks!
