On Sep 19, 2010, at 10:58 PM, Dave Porter wrote: > I am creating a new app which currently just has a company and tasks - > tasks is belongs_to company and company has_many tasks. > > I'm reading the 'Controllers and Routing' docs and it has an example > of 'Writing an action from scratch'. > With this code: > > def index > @adverts = Advert.published.all > end > > Mine is the same but for tasks > > def index > @tasks = Task.status.all > end > > But I get an error: > undefined method `total_pages' for #<Array:0x639c6a8> >
The default index page tag includes page-nav, which (as you've noted) dies badly when passed a collection without will_paginate-fu. Adding: paginate? false to the corresponding view hint file will tell the DRYML generator to knock it off. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
