<%= f.collection_select :admin_attachment_id, @data['attachments'], :id, :title, { prompt: 'Select banner' }, { class: 'form-control', required: '', 'ng-model': 'banner.admin_attachment_id', 'ng-change': 'get_attachment_thumbnail()', disabled: 'Select banner', selected: '' } %>
渲染:
<select class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required" required="required" ng-model="banner.admin_attachment_id" ng-change="get_attachment_thumbnail()" name="admin_banner[admin_attachment_id]" id="admin_banner_admin_attachment_id">
<option value="">Select banner</option>
<option value="89">Banner 1</option>
<option value="94">Banner 2</option>
<option value="114">Banner 3</option>
</select>
我正在尝试将第一个选项设置为选定项目,但必须禁用。我怎样才能做到这一点?