【发布时间】:2016-02-03 12:26:22
【问题描述】:
我在我的 rails 应用程序中使用 simple_form。我想禁用下拉列表中的特定值。
这是部分代码
= simple_form_for(@organization,url: admin_organization_path) do |f|
= f.input :hospital_name, input_html: { class: "form-control"}
= f.input :parent, collection: @organizations, input_html: { class: "form-control", id: "chosen-select-speciality"}
我尝试使用:disabled => @organizations.first,但失败了。
有没有其他方法可以使用。请帮助我。谢谢。
【问题讨论】:
-
您好,您使用的是
chosen-rails吗?
标签: ruby-on-rails simple-form multi-select jquery-chosen slim-lang