我试图在我的rails 3应用程序中设置思维狮身人面像。我设置了mysql并安装了sphinx,没有错误。在我的gemfile中,我有Rails思维狮身人面像方法
gem "riddle", "~> 1.5.0"
gem "thinking-sphinx", "~> 2.0.10"
这些安装正常。在我的模型,我有
define_index do
indexes :name
indexes acad_field
indexes expertise
indexes interests
indexes experience
indexes marital_status
indexes email
indexes place_of_birth
indexes birthyear
indexes hometown
indexes current_residence
indexes languages
indexes nationalities
indexes ethnicities_mom_dad
indexes institution
indexes program
end
,在我在我的控制指标,我有
def index
#@profiles = Profile.all
@profiles = Profile.search params[:search]
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @profiles }
end
end
在我的路线
我有
match "profiles?search=:search", :to => "profiles#index"
当我尝试运行搜索我的错误
Routing Error
undefined method `define_index' for #<Class:0xb3ada670>
我是什么doi这里错了。
也许相关:http://stackoverflow.com/questions/4807509/error-while-using-thinking-sphinx-under-ruby-on-rails – fuzzyalej