bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 572 forks source link

Value interpreted as an array #486

Open sqbell opened 9 years ago

sqbell commented 9 years ago

I use BIP to edit strings that look like so: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]. When I click on a field to edit it, Sun,Mon,Tue,Wed,Thu,Fri,Sat is displayed though. When I click away, this is what is sent to the server.

The problem is that reading from data-bip-original-content (https://github.com/bernat/best_in_place/blob/master/lib/assets/javascripts/best_in_place.js#L202) with .data() method parses the string into JS array.

Is there any way to keep working with a string instead of having it parsed as an array?

skladd commented 6 years ago

Facing the same issue...