On Nov 28, 2010, at 5:41 AM, Joachim Filip Bartosik wrote:

> W dniu 27.11.2010 21:30, jaclinuxhelp pisze:
>> Hi!:
>> 
>> Im doing this on my custom controller:
>> 
>> def router
>>    ...
>>    @licenses = License.find(result)
>>    hobo_index @licenses, :paginate => false
>> end
>> 
>> 
>> And when invoking the "method", i get this:
>> 
>> undefined method `default_order' for #<Array:0x7f64e203c660>
> 
> 
> As far as I remember hobo_index expects a named_scope.
> License.find(result) returns instance of License so it will not work. If
> you did something like
> 
> hobo_index License.all :conditions => { conditions }
> 
> it should work.

Nope - .all does the query and returns a real array. To make things work with 
the pagination done by hobo_index, you'll need to say:

hobo_index License.scoped(:conditions => ... )

Which will return an AssociationCollection proxy object instead of an array.

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

Reply via email to