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 %>
<fieldset>
<legend>Search</legend>
<div class="search">
<label for="q">Search:</label>
<%= text_field_tag "q", params[:q] %>
<input type="submit" value="Search" />
</div>
</fieldset>
<% 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
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.