Hi Stephen

It looks like you're not using Thinking Sphinx in the controller - unless those 
scopes are Sphinx scopes? If so, don't use the paginate method, use the search 
method chained at the end with the :page option. I'm not familiar with the 
purpose of :total_entries though - care to clarify?

And if those aren't Sphinx scopes - why do you think this is related to TS?

Cheers

-- 
Pat

On 22/08/2011, at 6:03 AM, Stephen wrote:

> My View:
> -----------
> = will_paginate @groups in my controller
> 
> 
> My Controller:
> ------------------
> @groups = Group.public_groups.sort_by_popularity.paginate :page =>
> params[:page], :total_entries => Group.public_groups.size
> 
> 
> 
> 
> I'm getting this error when trying to use the two together:
> 
> undefined method `/' for #<ActiveSupport::OrderedHash:
> 0x0000000523bfb0>
> 
> vendor/bundle/ruby/1.9.1/gems/will_paginate-3.0.pre4/lib/will_paginate/
> finders/active_record.rb:86:in `total_pages'
> vendor/bundle/ruby/1.9.1/gems/will_paginate-3.0.pre4/lib/will_paginate/
> view_helpers/base.rb:43:in `will_paginate'
> vendor/bundle/ruby/1.9.1/gems/will_paginate-3.0.pre4/lib/will_paginate/
> view_helpers/action_view.rb:31:in `will_paginate'
> app/views/groups/_groups.haml:2:in
> `_app_views_groups__groups_haml__993634138_133514612_112010'
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" 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/thinking-sphinx?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" 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/thinking-sphinx?hl=en.

Reply via email to