werein / x-editable-rails

Edit fields easily with X-Editable helper

Home Page:https://wereinhq.com/guides/x-editable-rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Select uses value instead of text as display

mendelk opened this issue · comments

In order for xeditable to display select values properly, the element being used (span by default) should not have any content in it, and xeditable will generate the value based on the data-value and the data-source.

However, because x-editable-rails will generate content in every element-type case, we end up seeing the value and not the text. (So if the data-source is [{text: "Male", value: "male"}, {text: "Female", value: "female"}], and the data-value is male, we end up seeing male, and not Male).

This behavior is defined here

Pull request cannot be easily merged anymore, so I made update manually. Based on you code. Thanks!