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

:display_as doesn't play well with :select #533

Open dexterouschen opened 8 years ago

dexterouschen commented 8 years ago

if I use :dislay_as in :select, every time I change the value, the field is displayed correctly but when I refresh the page, the actual option value will be used instead.

for example,

<%= best_in_place some_instance, :some_id, as: :select, collection: some_collection, display_as: :some_display_method, place_holder: "N/A" %>

Let's say some_collection contains [[1,"a"],[2,"b"],[3,"c"]]

And :some_display_method will do capitalization.

the capitalized value generated by :some_display_method will be used when I change the value, but not when the initial load happens, which means the lowercase letter is used.

I'm using Rails 4.2.5, best_in_place 3.1.0.

jmwelch commented 7 years ago

Any updates with this?