<%= 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: '' } %>
Renderized:
<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>
I'm trying to set the first option as selected item, but must be disabled. How can I do this?
I'm using it in a
select_tag
, but you need a form of grouped options: