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 571 forks source link

Place holder disappears after updating value to nil #538

Closed pcelic closed 8 years ago

pcelic commented 8 years ago

I have quite a few selects that need to be nullable, and can be updated to nil even after a value has been set. When I load the page initially, nil values show the place_holder value. However, if I click, but select the nil value in the select, after the PUT action is complete, the place_holder value disappears and the value is no longer editable until the page reloads. Is there a way to continue to show the place_holder value after an item has been updated to nil?

pcelic commented 8 years ago

Found the problem. If in the collection you say "collection { nil: "SomeText", values. . . } it doesn't disappear. I was using "collection { nil: nil }