2011-11-07 67 views
1

我想在Rails 3.1下自动完成工作。rails 3.1.1自动完成

https://github.com/crowdint/rails3-jquery-autocomplete

我一直在关注这个充满应用例子并改变相关部分为Rails 3.1,但它仍然没有工作。

https://github.com/crowdint/rails3-jquery-autocomplete-app

这里是我的applicaion.js文件

//= require jquery 
//= require jquery_ujs 
//= require jquery-ui 
//= require autocomplete-rails 
//= require_tree . 

我已经下载的jQuery 16年8月1日(含自动完成打勾),解压缩,并复制到JS我的应用程序/资产/ javascript目录和css &图片目录到app/assets/stylesheets。

我再发一个链接,这样我可以参考它在jQuery UI的

ln -s jquery-ui-1.8.16.custom.min.js jquery-ui.js 

同样与CSS

ln -s jquery-ui-1.8.16.custom.css jquery-ui.css 

然后我把一个链接到我的CSS在application.css

*= require_self 
*= require jquery-ui 
*= require_tree . 

我创建了品牌模型&迁移并添加了类似示例的种子数据。

我然后添加到我的欢迎控制器以下行具体根据教程:

autocomplete :brand, :name 

我固定了的routes.rb文件和编辑形式。

我得到的是没有自动完成的工作形式,也有我的服务器输出没有错误之一:

% rails s -p 3001    
=> Booting WEBrick 
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3001 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
[2011-11-07 16:35:53] INFO WEBrick 1.3.1 
[2011-11-07 16:35:53] INFO ruby 1.9.2 (2011-02-18) [x86_64-linux] 
[2011-11-07 16:35:53] INFO WEBrick::HTTPServer#start: pid=12616 port=3001 


Started GET "/" for 127.0.0.1 at 2011-11-07 16:35:54 +1100 
    Processing by WelcomeController#show as HTML 
Rendered welcome/show.html.erb within layouts/application (15.7ms) 
Completed 200 OK in 98ms (Views: 75.6ms | ActiveRecord: 0.0ms) 


Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /application.css - 304 Not Modified (0ms) 


Started GET "/assets/jquery-ui.css?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /jquery-ui.css - 304 Not Modified (5ms) 


Started GET "/assets/jquery-ui-1.8.16.custom.css?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /jquery-ui-1.8.16.custom.css - 304 Not Modified (1ms) 


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /jquery.js - 304 Not Modified (1ms) 


Started GET "/assets/welcome.css?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /welcome.css - 304 Not Modified (2ms) 


Started GET "/assets/jquery-ui.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /jquery-ui.js - 304 Not Modified (5ms) 


Started GET "/assets/jquery-ui-1.8.16.custom.min.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /jquery-ui-1.8.16.custom.min.js - 304 Not Modified (3ms) 


Started GET "/assets/welcome.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /welcome.js - 304 Not Modified (2ms) 


Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /application.js - 304 Not Modified (0ms) 


Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /jquery_ujs.js - 304 Not Modified (1ms) 


Started GET "/assets/autocomplete-rails.js?body=1" for 127.0.0.1 at 2011-11-07 16:35:55 +1100 
Served asset /autocomplete-rails.js - 304 Not Modified (1ms) 

缺少什么我在这里? 是否有更新的Rails 3.1插件或更好的教程?

回答