請教auto complete的問題

3 views
Skip to first unread message

joehwang

unread,
May 23, 2007, 12:21:04 PM5/23/07
to Ruby on Rails Taiwan
大家好,我auto complete的功能一直作不出來,請大家幫我看看
我有個countries的table,裡面有id和name兩個欄位
controller:
auto_complete_for :country, :name


View:
<%=javascript_include_tag :defaults %>
Country: <%=text_field_with_auto_complete :country, :name %>

錯誤訊息是
undefined method `auto_complete_for' for #<TestautoController:
0x47293c8>

可是在railsAPI明明有提供這個method阿@@
請問有人有相同問題的經驗嗎?謝謝

Message has been deleted

joehwang

unread,
May 25, 2007, 8:21:26 AM5/25/07
to Ruby on Rails Taiwan
我找到原因了@@
因為我把auto_complete_for把在我的function裡,所以才會出錯
錯誤:
class SearchController < ApplicationController
def index
auto_complete_for :recipe, :name
end
end


正確:
class SearchController < ApplicationController
auto_complete_for :recipe, :name
end

Reply all
Reply to author
Forward
0 new messages