对于我的模型,:start_date是一个attr_ccessor。这似乎可以防止残疾:工作正常。我尝试的另一个选项:enable_blank,工作正常
<%= b.select :start_date, options_for_select(dates(b.object.proposed_start), selected: b.object.start), disabled: true %>
答案 0 :(得分:0)
以下应该工作:
<%= b.select :start_date, options_for_select(dates(b.object.proposed_start), selected: b.object.start), {}, { disabled: true } %>
在Rails Apidocks中查看更多内容:
http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/select