I am using Rails 2.1 and implemented Sunspot search. The server is running fine, but the problem is when I am searching for a text, it is showing an error like this:
undefined method `all_text_fields' for nil:NilClass
Can anybody 开发者_运维百科knowledgeable about the solution to this problem please help me?
Thank you.
That's most likely an error coming from inside the sunspot gem. It can occur if your model isn't setup right. Do you have a searchable block in the model you are trying to run a search on?
e.g.:
class Foo > ActiveRecord::Base
searchable do
integer :size
end
end
精彩评论