The issue you had with the blank pages comes from the polymorphic
default page tags - if there's no object(s) in 'this', Hobo renders
the default (which is empty).
I'd recommend you do this in the controller:
def index
@first_day_billing = Time.now.at_beginning_of_month
@last_day_billing = Time.now
@cdrs = Cdr.find(:all, :conditions => ['date >= ? AND date <= ?',
@first_day_billing, @last_day_billing], :order => 'unique_stamp')
end
(pulling the find call into the model - say a method this_month_so_far
- is up to you. If 'date' had a more descriptive name like billed_on,
you could also use Hobo's automatic scopes to say things like
Cdr.billed_before(Time.now), etc)
Note that the DRYML view code will automatically pick up the instance
variable with the pluralized model name and put it into 'this', so the
view can be the same. I'd also suggest that, unless the code in
invoice-page is going to be reused, it's probably better to just do it
inline. It avoids the problem that plain Rails sometimes gets into,
where a page is shattered into a million little partials.
--Matt Jones
There's also the sorthand <index-page without-top-page-nav without-
bottom-page-nav/>
Or just call Model.paginate, instead of Model.find
Tom