app/fields/views/radio/inline.html in volt-fields-0.1.3 vs app/fields/views/radio/inline.html in volt-fields-0.2.0

- old
+ new

@@ -1,24 +1,21 @@ <:Body> <div class="{{ if errors }}has-error{{ elsif marked }}has-success{{ end }} has-feedback"> - {{ attrs.options.each do |option| }} + {{ options.each do |option| }} <div class="radio-inline"> - {{ if checked?(option['value']) }} - <label class="radio-inline"> - <input type="radio" e-click="set_field(option['value'])" name="{{ @field_name }}_radio" value="{{option['value']}}" checked/> - {{ option['label'] }} - </label> - {{ if errors }} - <span class="glyphicon glyphicon-remove"></span> - <span class="control-label errors">{{ (errors || []).join(', ') }}</span> - {{ elsif marked }} - <span class="glyphicon glyphicon-ok"></span> + <label> + {{ if selected?(option) }} + <input type="radio" e-click="set(option)" name="{{ name }}" value="{{ option[:value] }}" checked/> + {{ else }} + <input type="radio" e-click="set(option)" name="{{ name }}" value="{{ option[:value] }}"/> {{ end }} - {{ else }} - <label class="radio-inline"> - <input type="radio" e-click="set_field(option['value'])" name="{{ @field_name }}_radio" value="{{option['value']}}"/> - {{ option['label'] }} - </label> + {{ option[:label] }} + </label> + {{ if errors }} + <span class="glyphicon glyphicon-remove"></span> + <span class="control-label errors">{{ (errors || []).join(', ') }}</span> + {{ elsif marked }} + <span class="glyphicon glyphicon-ok"></span> {{ end }} + </div> {{ end }} - </div> - </div> \ No newline at end of file + </div>