From e8496b60af411b614dcca5ed7f13d8642bff143f Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Wed, 5 Jul 2017 22:09:02 -0700 Subject: [PATCH] use display_as with select --- lib/best_in_place/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/best_in_place/helper.rb b/lib/best_in_place/helper.rb index e9be0795..ac13beed 100644 --- a/lib/best_in_place/helper.rb +++ b/lib/best_in_place/helper.rb @@ -22,7 +22,7 @@ def best_in_place(object, field, opts = {}) value = value.to_s collection = best_in_place_default_collection if collection.blank? collection = best_in_place_collection_builder(type, collection) - display_value = collection.flat_map{|a| a[0].to_s == value ? a[1] : nil }.compact[0] + display_value = collection.flat_map{|a| a[0].to_s == value ? a[1] : nil }.compact[0] unless opts[:display_as] collection = collection.to_json options[:data]['bip-collection'] = html_escape(collection) end