# Acts as ferret no search results

**URL:** <https://www.ruby-forum.com/t/acts-as-ferret-no-search-results/186396>\
**Category:** Rails\
**Created:** [April 6, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/acts-as-ferret-no-search-results/186396 "2010-04-06T13:39:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![catalin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7ba0ec/32.png) [@catalin](https://www.ruby-forum.com/u/catalin)\
**Post date:** [April 6, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/acts-as-ferret-no-search-results/186396/1 "2010-04-06T13:39:07Z")

</div>

Hi,

I`m having trouble with acts\_as\_feret gem. It renders no results.

First I \< require ‘acts\_as\_ferret’ \> in enviroment.rb.  
Then I use \< acts\_as\_ferret \> in every model I need. (user, spec,  
detalii)

I made a serch form partial.

\<% form\_tag({ :action =\> “Search” }, :method =\> “get”) do %\>

 Search 
 Search: \<%= text\_field\_tag "q", params[:q] %\> 
\<% end %\>

And in the controller:

def search  
if params[:q]  
query = params[:q]  
@users = User.find\_with\_ferret(query, :limit =\> :all)  
specs = Spec.find\_with\_ferret(query, :limit =\> :all)  
detalii = Detalii.find\_with\_ferret(query, :limit =\> :all)

```
  hits = specs + detalii
  @users.concat(hits.collect { |hit| hit.user }).uniq!

  @users.each { |user| user.spec ||= Spec.new }
  @users = @users.sort_by { |user| user.spec.name }
  @users = @users.paginate(:page => params[:page], :per_page => 10)
end

```

end

running on:

windows 7  
ruby 1.8.6  
rails 2.3.4  
acts\_as\_ferret 0.4.4  
ferret 0.11.5-x86-mswin32  
(using will\_paginate for pagination)

Can someone please help me or give me some advice it would be much  
appreciated! And I would like to go on with ferret for now not with  
sphinx.

Cata
