app/views/contacts/_show.html.erb in spud_inquiries-0.9.1 vs app/views/contacts/_show.html.erb in spud_inquiries-0.9.2
- old
+ new
@@ -1,20 +1,22 @@
-<%=form_for :spud_inquiry, :url => "/contact/inquire",:html => {:class => "form-horizontal"} do |f|%>
+<%=form_for :spud_inquiry, :url => contact_inquire_path,:html => {:class => "form-horizontal", :id => "inquiry_form_#{inquiry_form.id}"}, :remote => true do |f|%>
+<%#=error_messages_for(@inquiry)%>
+
<fieldset>
<%=f.hidden_field :spud_inquiry_form_id,:value => inquiry_form.id%>
<%inquiry_form.spud_inquiry_form_fields.each do |field|%>
- <div class="control-group">
+ <div class="control-group type_<%=field.field_type%>">
<%=f.label field.name,:class => "control-label"%>
<div class="controls">
<%=case field.field_type
when '0'
- f.text_field field.name,:value => field.default_value
+ f.text_field field.name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.name].blank? ? field.default_value : params[:spud_inquiry][field.name], :placeholder => field.placeholder
when '1'
- f.check_box field.name,:value => field.default_value
+ f.check_box field.name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.name].blank? ? field.default_value : params[:spud_inquiry][field.name]
when '2'
- f.text_area field.name,:value => field.default_value,:rows=>5,:cols => 70
+ f.text_area field.name,:value => params[:spud_inquiry].blank? || params[:spud_inquiry][field.name].blank? ? field.default_value : params[:spud_inquiry][field.name],:rows=>5,:cols => 70, :placeholder => field.placeholder
when '3'
f.select field.name,field.options_list.collect {|opt| [opt,opt]},:include_blank => true
end%>
</div>
</div>