<%= form_for formparams, :method => :post, :html => { :class => "form-inline mass-inserting #{(params[:mass_inserting] ? 'setfocus' : '')}" } do |f| %>
<%= hidden_field_tag :mass_inserting, true %>
<% for col in model_columns %>
class="form-group mr-sm-2 col-<%= col %>">
<%=
ar = model.columns_hash[col]
if !ar.nil?
case ar.type
when :integer then
if col =~ /.*_id/
f.collection_select((col).to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q]["#{col}_eq"].to_i rescue '' end) }, {:class => "form-control"})
else
f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col), default: "#{model_name}.#{col}").capitalize, :class => "form-control")
end
when :boolean then
(
"".html_safe
)
else
f.text_field(col.to_sym, :placeholder => t(i18n_translate_path(model_name, col), default: "#{model_name}.#{col}").capitalize, :class => "form-control")
end
else
f.collection_select(("#{false ? "#{engine}_" : ''}#{col}_id").to_sym, ("#{(engine.blank? ? '' : "#{engine.camelize}::")}#{col.camelize}").constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q]["#{col}_id_eq"].to_i rescue '' end) }, {:class => "form-control"})
end
%>
<% end %>
<%= f.submit t(:create, :default => "Create"), :class => "btn btn-outline-secondary", :data => { :disable_with => t(:saving, :default => "Saving...") } %>
<% end %>