2010-08-23 66 views
0

我一直在努力得到一个简单的自动完成与使用jQuery UI“自动完成”我已经使用jRails我的Rails应用程序工作,所以我尝试使用jrails_auto_completejrails_auto_complete设置帮助

我把它喜欢它说,在README,但我得到了下面的JavaScript错误,当我开始在框中键入:

Failed to load resource: the server responded with a status of 404 (Not Found) 

URL: /users/auto_complete_for_user_name?term=a 

当我调试它,它说:

找不到用户与ID = auto_complete_for_user_name

任何想法?我认为这将需要比列出的两个步骤更多,但我敢肯定,我设置这两个正确...

回答

0

想通了,你需要添加以下到您的routes.rb文件:

map.resources :users, :collection => {:auto_complete_for_user_name => :get}