Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best_in_place gem initializing

rails 3.2.11

Gemfile:

gem 'jquery-rails'
gem "best_in_place"

aplication.js

//= require jquery
//= require jquery_ujs
//= require best_in_place

post.js.coffee

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

show.html.erb

<%= best_in_place @post, :title %>

inline form viewed but i got js exception and nothing fired on enter, loose focus etc. traceback:

Uncaught SyntaxError: Unexpected token u jquery.js:525
jQuery.extend.parseJSON jquery.js:525
BestInPlaceEditor.setHtmlAttributes best_in_place.js:265
BestInPlaceEditor.forms.input.activateForm best_in_place.js:309
BestInPlaceEditor.activate best_in_place.js:54
BestInPlaceEditor.clickHandler best_in_place.js:260
jQuery.event.dispatch jquery.js:3046
elemData.handle

lines at jquery.js

if ( window.JSON && window.JSON.parse ) {
  return window.JSON.parse( data );

how i can fix this?

upd problem solved. do same changes but all works fine. magic ;)

like image 737
oleg.vodopyan Avatar asked Oct 21 '22 19:10

oleg.vodopyan


1 Answers

Using the git version of the gem resolved it in my case.

gem 'best_in_place', github: 'bernat/best_in_place'

like image 91
Stefan Avatar answered Oct 29 '22 22:10

Stefan