Here is the solution that i implemented after a lot of research.
You are getting the error because you are calling the paginate method
in the old fashion. You need to call it in the new way by passing the
parameters as a hash.
See Below.
def index
chaps = []
page = params[:page]
per_page = 10
moduls = Modul.filter(params[:search], per_page, page,
get_conditions_hash, sort_order('modul_name'))
moduls.each { |modul| chaps << modul.modulable }
@chapters = chaps.paginate :page => page, :per_page => per_page
end
Regards,
Pratik
On Aug 3, 2:46 pm, smeed652 <[email protected]> wrote:
> I'm using the latest version for both ThinkingSphinx (1.2.5) and
> mislav-will_paginate (2.3.11) and I get the exception. I've seen a
> number of write-ups on this but never the solution--at least for what
> I can tell.
>
> Here is the exception and the associated code.
>
> NoMethodError in Video_searches#index
>
> Showing app/views/video_searches/index.html.erb where line #66 raised:
>
> undefined method `total_pages' for []:Array
>
> Extracted source (around line #66):
>
> 63: <% end %>
> 64: </tbody>
> 65: </table>
> 66: <%= will_paginate @videos %>
> 67: </body>
> 68: </html>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---