0
我正在使用Rails 3.1,并在尝试使用任何jQuery扩展时不断收到错误消息。rails coffescript&haml include errors
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);
但是,如果我硬链接的JavaScript扩展这样的:
%script{:src => "https://raw.github.com/bernat/best_in_place/master/lib/assets/javascripts/best_in_place.js", :type => "text/javascript"}
一切似乎工作。
我的脚本文件呈现:
谢谢!
我更新了错误描述。谢谢 – 2012-03-31 11:58:33
我所有的jQuery插件都打破了... – 2012-03-31 14:55:15
你是如何在你的应用程序中安装best_in_place.js的? – 2012-03-31 15:26:42