X-Editable Rails 下拉布尔值
X-Editable Rails Dropdown Boolean Values
我正在使用 X-Editable 更改布尔值。目前下拉菜单提供了两个选项,"Yes" 和 "No",但是我想将其更改为 "Active" 和 "Inactive"。
<%= editable user, :active %>
我试过添加这样的选项:
<%= editable user, :active, [['Active', true], ['Inactive', false]] %>
但是会抛出以下 NoMethodError:
undefined method `each_pair' for [["Active", true], ["Inactive", false]]:Array
Did you mean? each_slice
我正在使用 X-Editable 更改布尔值。目前下拉菜单提供了两个选项,"Yes" 和 "No",但是我想将其更改为 "Active" 和 "Inactive"。
<%= editable user, :active %>
我试过添加这样的选项:
<%= editable user, :active, [['Active', true], ['Inactive', false]] %>
但是会抛出以下 NoMethodError:
undefined method `each_pair' for [["Active", true], ["Inactive", false]]:Array
Did you mean? each_slice