开发者

undefined method `all_text_fields' for nil:NilClass

开发者 https://www.devze.com 2023-01-22 20:39 出处:网络
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:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消