0

我正在尝试在我的一个观点上实施 Best In Place Gem。但是,当我单击示例按钮时,什么也没有发生,并且 Chrome 检查会弹出错误 -

更新 你可以看看这里的一个例子——>

https://fierce-meadow-1536.herokuapp.com/users/10/common_apps/6/edit

username: tester@tester.com
password: 123123

--

Uncaught TypeError: Property 'jQuery' of object [object Object] is not a function best_in_place.js?body=1:52
Uncaught TypeError: Property 'jQuery' of object [object Object] is not a function best_in_place.js?body=1:595

参考中的特定javascript(#comment上方)-->

  this.oldValue = this.isNil() ? "" : this.element.html();
    this.display_value = to_display;
    jQuery(this.activator).unbind("click", this.clickHandler);
    #Uncaught TypeError: Property 'jQuery' of object [object Object] is not a function 
    this.activateForm();
    this.element.trigger(jQuery.Event("best_in_place:activate"));
  },

这是我的 Application.js 文件——

//= require jquery
//= require jquery_ujs
//= require chosen-jquery
//= require jquery_nested_form
//= require best_in_place
//= require_tree .

我的观点 -

== best_in_place @common_app, :cover_letter, :path => user_common_app_path(@user,@common_app),  :type => :textarea

用户.js.coffee

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

怎么了?

4

1 回答 1

0

我没能找到解决办法,宝石上的活动似乎已经下降了很多。

最终找到了适用于 x-editable 的 rails 改编,-- https://github.com/werein/x-editable-rails

它是新的,所以要注意它,但它运行良好,开发人员非常活跃。

于 2014-01-15T23:22:13.070 回答