<%- 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 %>
<%= form.hidden_field "remove_#{elem.name}", value: "1", disabled:"disabled", class: 'dynamicScaffoldJs-image-remove-flag' if elem.options[:removable]%>
<%= elem.render(self, form, 'form-control-file dynamicScaffoldJs-image') do |attr|%>
<%= form.file_field(elem.name, attr) %>
<%end%>
<% 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-%>