2012-03-31 2 views
0

레일 3.1을 사용하고 있으며 jQuery 확장을 사용하려고 할 때 오류가 계속 발생합니다.rails coffescript & haml에 오류가 있습니다.

kintouch.js.coffee

jQuery -> 
    $('.best_in_place').best_in_place() 

index.html.haml

= best_in_place contacts[0].label, :name, :display_as => :header_short, 
     :inner_class => "span2" 

가 application.js

//= require jquery 
//= require jquery_ujs 
//= require jquery.purr 
//= require best_in_place 
//= require_tree . 

kintouch.js 오류

(function() { 

     jQuery(function() { 
     return $('.best_in_place').best_in_place(); 
    Uncaught TypeError: Object [object Object] has no method 'best_in_place' 
     }); 

    }).call(this); 
0

그러나이 같은 자바 스크립트 확장에 대한 하드 링크하는 경우 :

%script{:src => "https://raw.github.com/bernat/best_in_place/master/lib/assets/javascripts/best_in_place.js", :type => "text/javascript"} 

모든 작동하는 것 같다.

내 스크립트 파일 렌더링 :

enter image description here

감사합니다!

+0

설명을 오류로 업데이트했습니다. 감사합니다 –

+0

내 jQuery addons가 모두 깨고 있습니다. –

+0

어떻게 best_in_place.js를 앱에 설치 했습니까? –

답변

0

jQuery가 두 번로드되어 부트 스트랩을 타고 넘어졌습니다.

관련 문제