2011-11-07 3 views
1

Rails 3.1에서 자동 완성 기능을 사용하려고합니다.rails 3.1.1 autocomplete

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

나는이 전체 응용 프로그램의 예를 다음과 레일 3.1 관련 부분을 변경,하지만 여전히 작동하지 않습니다되었다. 여기

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

내 applicaion.js가 (자동 완성 쳤다로) 나는 JQuery와 1.8.16을 다운로드 한

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

파일은 압축을 푼과에 JS를 복사 내 응용 프로그램/자산/자바 스크립트 디렉토리 및 CSS & 이미지 디렉토리를 app/assets/stylesheets에 복사합니다. 나는 CSS

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

내가 application.css

내 CSS에 링크를 걸어와

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

같은 JQuery와 - UI로 참조 할 수 있도록

나는 다음 링크를 만들어

*= 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 또는 더 나은 튜토리얼을위한 최신 플러그인이 있습니까?

답변

1

나는

여기

은 다른 사람이 걸리면에서의 경우 내 노트는 커피 스크립트와 JQuery와 - UI의 도움으로 직접 그 일을 결국 : https://gist.github.com/1347080