I’ve just recently started learning rails, and everything is going well
for my find(:all) situations. I’m now trying to do limited find, vis:
def bug_table @Bug_list = Bug.find(:all, :conditions => [ "bug_status NOT LIKE 'CLOSED' and
bug_status NOT LIKE ‘VERIFIED’" ]
@bug_pages, @bugs = paginate @Bug_list, :per_page => 25,
<-- line 22
:order_by => ‘priority, bug_severity, bug_id’
render :action => 'list' end
and I get
The error claims the problem is in
app/controllers/bugs_controller.rb:22:in `bug_table’, which I presume
means lines 22 & 23 (it’s a continued line) – so it doesn’t seem to
want to … what? Does paginate require a “constant”? I thought that
making @Bug_list start with a capital letter would made it a constant.
The probem seems to be more along the line that an array (of
bug-objects) is returned, and I can’t seem to feed those to paginate.
By comparison, this works just fine:
def list @bug_pages, @bugs = paginate :bugs, :per_page => 25, :order_by => 'priority, bug_severity, bug_id' end
Any help or hints about how to do the thing I want in bug_table?