我試圖在我的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