app/fields/views/select/index.html in volt-fields-0.1.3 vs app/fields/views/select/index.html in volt-fields-0.2.0
- old
+ new
@@ -1,16 +1,18 @@
<:Body>
<div class="form-group {{ if errors }}has-error{{ elsif marked }}has-success{{ end }} has-feedback">
{{ if label }}
<label class="control-label">{{ label }}</label>
{{ end }}
- <select value="{{ attrs.value }}" e-focusout="blur" class="form-control">
+ <select value="{{ attrs.value }}" e-change="blur" class="form-control">
+ {{ if attrs.value.nil? }}
+ <option value="" selected>
+ </option>
+ {{ end }}
{{ options.each do |option| }}
- {{ if selected?(option[:value]) }}
- <option value="{{ option[:value] }}" selected> {{ option[:label] }}</option>
- {{ else }}
- <option value="{{ option[:value] }}"> {{ option[:label] }}</option>
- {{ end }}
+ <option value="{{ option[:value] }}">
+ {{ option[:label] }}
+ </option>
{{ end }}
</select>
{{ if errors }}
<span class="glyphicon glyphicon-remove form-control-feedback"></span>
<span class="control-label errors">{{ (errors || []).join(', ') }}</span>