# RecordNotFound with ID=search?

**URL:** <https://www.ruby-forum.com/t/recordnotfound-with-id-search/138383>\
**Category:** Ferret\
**Created:** [May 22, 2008, 2:12pm UTC](https://www.ruby-forum.com/t/recordnotfound-with-id-search/138383 "2008-05-22T14:12:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![san1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@san1981](https://www.ruby-forum.com/u/san1981)\
**Post date:** [May 22, 2008, 2:12pm UTC](https://www.ruby-forum.com/t/recordnotfound-with-id-search/138383/1 "2008-05-22T14:12:24Z")

</div>

Hello,

I’ve installed the plugin act\_as\_ferret and I try to install this on my  
model “question”.

For this, I’ve then add this in questions\_controller.rb

def search  
@results = Question.find\_by\_contents(@search) unless  
@search.to\_s.blank?  
@search = params[:q]  
end

My model question.rb is so:

class Question \< ActiveRecord::Base  
acts\_as\_ferret :fields =\> [:description, :answer]  
end

In the view search.html.erb I’ve added this:

\<% if @results %\>  
\<% for question in @results %\>  
\<%= question.description %\>  
\<% end %\>  
\<% else %\>

No result

  
\<% end %\>

In the file application.html.erb, I’ve add a form to make the search so:

With sending of a search, I receive this notification:  
ActiveRecord::RecordNotFound in QuestionsController#show  
Couldn’t find Question with ID=search

Someone has an idea?  
Thanks,
