所以我目前正在嘗試從2.3 - > 3升級,並且遇到了問題。在rails 2.3中,我有一個由自動完成方法組成的模塊。所以在按鍵上ajax請求會被髮送到相應的消息。例如:Rails3模塊幫助
/授權/ auto_complete_for_grant_name
module AutoComplete
def auto_complete_for_grant_name
name = params[:grant][:name].downcase
@grants = Grant.find(:all, :limit => 10, :conditions => "name like '%"+name+"%'")
render :partial => 'global/grants'
end
end
一旦我升級到Rails3中,這是壞了。我已經包括:
config.autoload_paths << "#{Rails.root}/lib"
在我的application.rb中
,並:
include AutoComplete
在我的應用程序控制器。
我在做什麼錯?謝謝!
編輯: (螢火蟲輸出):未能加載源:http://localhost:3000/grants/auto_complete_for_grant_name
任何錯誤信息? – 2010-11-23 19:56:21
你有任何錯誤信息? 「這是打破」有點太模糊調試好。有關具體是什麼被打破的更多信息將有很大幫助。 – jergason 2010-11-23 19:56:42
你得到的錯誤信息是什麼? – markquezada 2010-11-23 19:58:19