2011-11-07 64 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插件或更好的教程?

回答