jrails_auto_complete 设置帮助

发布于 2024-09-15 03:51:46 字数 584 浏览 0 评论 0原文

我一直在努力使用 jQuery UI“自动完成”来使用我的 Rails 应用程序进行简单的自动完成,我已经在使用 jRails,所以我尝试使用 jrails_auto_complete

我按照自述文件中的说明进行了设置,但是当我开始在框中输入时,出现以下 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 的用户

有什么想法吗?我认为这将需要比列出的两个步骤更多的步骤,但我很确定我正确设置了这两个步骤......

I have been struggling to get a simple autocomplete working with my Rails app using the jQuery UI 'autocomplete' I'm already using jRails, so I tried using the jrails_auto_complete

I set it up like it says in the README, but I get the following javascript error when I start typing in the box:

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

URL: /users/auto_complete_for_user_name?term=a

And when I debug it it says:

Couldn't find User with ID=auto_complete_for_user_name

Any ideas? I would think it would take more than the two steps listed but I'm pretty sure I setup those two correctly...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同尘 2024-09-22 03:51:46

发现您需要将以下内容添加到您的routes.rb 文件中:

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

Figured out that you need to add the following to your routes.rb file:

map.resources :users, :collection => {:auto_complete_for_user_name => :get}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文