简体   繁体   中英

Best In Place : Uncaught TypeError: Property 'jQuery' of object [object Object] is not a function

I'm trying to implement the Best In Place Gem on one of my views. However, when I click a sample button, nothing happens, and Chrome inspect pops out the error --

Update You can take a look at an example here -- >

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

The specific javascript in reference (Above the #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"));
  },

This is my Application.js file --

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

My view --

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

Users.js.coffee

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

What is happening?

I wasn't able to find a fix, it seems like activity on the gem has declined quite a bit.

Ended up finding a rails adaptation for x-editable, -- https://github.com/werein/x-editable-rails

It is new, so be aware of it, but it worked well and developer is very active on it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM