<%=f.label field.field_name, field.name,:class => "control-label"%>
<%=case field.field_type
when '0'
f.text_field field.field_name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.field_name].blank? ? field.default_value : params[:spud_inquiry][field.field_name], :placeholder => field.placeholder
when '1'
f.check_box field.field_name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.field_name].blank? ? field.default_value : params[:spud_inquiry][field.field_name]
when '2'
f.text_area field.field_name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.field_name].blank? ? field.default_value : params[:spud_inquiry][field.field_name],:rows=>5,:cols => 70, :placeholder => field.placeholder
when '3'
f.select field.field_name,options_for_select(field.options_list.collect {|opt| [opt,opt]}, params[:spud_inquiry].blank? || params[:spud_inquiry][field.field_name].blank? ? field.default_value : params[:spud_inquiry][field.field_name]), {:include_blank => true}
end%>
<% if @spud_inquiry != nil and @spud_inquiry.errors[field.field_name].length > 0 %>
<% @spud_inquiry.errors[field.field_name].each do |error| %> <%= error %> <% end %>
<% end %>
<%end%>
<%=f.submit "#{inquiry_form.submit_title || 'Submit Inquiry'}",:class => "btn btn-primary"%>