views:

70

answers:

1

I have installed will_paginate and acts_as_ferret on my system for ruby rails.
My paginate seems to work fine before installing acts_as_ferret. When I put in the code to do searching I get the following error:

NoMethodError in Community#search  

Showing app/views/community/_result_summary.rhtml where line #3 raised:  

undefined method `total_entries' for []:Array  

Extracted source (around line #3):  

1: <% if @users %>  
2: <p>  
3: Found <%= pluralize(@users.total_entries, "match") %>.  
4: </p>  
5: <% end %>  

If I take out the search function, paginate works but it's pointless because I can't do searches. Can any one help me out on this one??

Thanks!!

Stephen

A: 

undefined method `total_entries' for []:Array

eror itself shows that you are calling total_entries method which is not array method. you get more than one user in your @users. try

1: <% unless @users.blank? %>  
2: <p>  
3: Found <%= pluralize(@users[0].total_entries, "match") %>.  
4: </p>  
5: <% end %>  

EDITED TRY

1: <% unless @users.blank? %>  
2: <p>  
3: Found <%= pluralize(@users.length, "match") %>.  
4: </p>  
5: <% end %>  
Salil
still getting the same error this time on line 3. Ruby is telling me that undefined method 'total_entries'
by the way -- with this code -- the search is blank but the paginate returns an error.
check my edited answer and let me know.
Salil
As far as I know, `total_entries` is an array method. It's from `will_paginate`.
j.
Salil: This was close!! The paginate works -- but the advanced search using ferret now returns blank (nothing). What information can I give you to help me debug this?? I am a total newbie when it comes to RoR!!Thanks for this!!!Stephen