I am trying to modify the controller action hobo_index in order to limit a 
find.    The hobo-at-work book has no examples, so I'm struggling to understand 
"hobo_index takes a "finder" as an optional first argument, and then options" . 
  My find would be 

@assignments = Assignment.find(:all, :order => "due_date ASC" , :conditions => 
["show_date <= ?", Time.now])

How can I write the hobo_index line to reflect this?

==========

Reading the stuff on page 85 of hobo-at-work I also tried adding to the end of 
AssignmentsController

def index
    @assignments = Assignment.find(:all, :order => "due_date ASC" , :conditions 
=> ["show_date <= ?", Time.now])
  end

but I got

NoMethodError in AssignmentsController#index

undefined method `total_pages' for #<Array:0x10566dbd0>

So I think the line on that page:

"in other words you don't need to do anything different than you would in a 
normal Rails action" 

is maybe not true.   I assume its trying to paginate, which I don't want to 
turn off - I'm all in favor of pagination.


Thanks for all the help,


Mark


-- 
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.

Reply via email to