<%- elem.insert(:before).each do |block| -%>
<%= self.instance_exec(@record, &block) %>
<%-end-%>
<% if elem.type? :collection_check_boxes %>
<%= elem.render(self, form) do |cb|%>
<%= cb.label class: 'form-check-label' do%>
<%= cb.check_box class: 'form-check-input' %> <%= cb.text %>
<%end%>
<%end%>
<% elsif elem.type? :collection_radio_buttons %>
<%= elem.render(self, form) do |cb|%>
<%= cb.label class: 'form-check-label' do%>
<%= cb.radio_button class: 'form-check-input' %> <%= cb.text %>
<%end%>
<%end%>
<% elsif elem.type? :carrierwave_image %>
<%- image = form.object.public_send(elem.name) -%>
<% if elem.options[:removable] %>
<% end %>
<%- if elem.cropper.present? -%>
<%= form.hidden_field "cropper_#{elem.name}", class: "js-ds-image-cropper", data:{options: elem.cropper.to_json} %>
<%- end -%>
<%= form.hidden_field "remove_#{elem.name}", value: "1", disabled:"disabled", class: 'js-ds-image-remove-flag' if elem.options[:removable]%>
<%= elem.render(self, form, 'form-control-file js-ds-image') do |attr|%>
<%= form.file_field(elem.name, attr) %>
<%end%>
<%= form.hidden_field "#{elem.name}_cache" %>
<% else %>
<%= elem.render(self, form, class_names('form-control', {'is-invalid': errors.present?})) %>
<% end %>
<%- elem.insert(:after).each do |block| -%>
<%= self.instance_exec(@record, &block) %>
<%-end-%>