<% (form_ordered_fields - ['id', 'created_at', 'updated_at', 'deleted_at'] - excluded_columns).each do |column| %>
<% wphtml = "col-md-#{(form_fields[column.to_sym].class == Hash ? form_fields[column.to_sym][:size] : form_fields[column.to_sym] ) || 12}" %>
<% hint = (form_fields[column.to_sym].class == Hash ? form_fields[column.to_sym][:hint] : '') %>
<% placeholder = (form_fields[column.to_sym].class == Hash ? form_fields[column.to_sym][:placeholder] : '') %>
<% if object.class.column_for_attribute(column).type == :text %>
<%= f.input column, input_html: { rows: 10, cols: 20 }, wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
<% elsif [:date, :datetime].include?(object.class.column_for_attribute(column).type) %>
<%= f.input column, html5: true, wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
<% elsif /_id$/ =~ column && object.respond_to?(column.split('_id')[0]) %>
<% if restricted_columns.keys.include?(column.to_sym) %>
<%= f.association column.split("_id")[0],
label: restricted_columns[column.to_sym][:label],
collection: restricted_columns[column.to_sym][:collection],
wrapper_html: { class: wphtml },
hint: hint, placeholder: placeholder
%>
<% else %>
<%= f.association column.split("_id")[0], wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
<% end %>
<% else %>
<%= f.input column, wrapper_html: { class: wphtml }, hint: hint, placeholder: placeholder %>
<% end %>
<% end %>