Skip to content

Instantly share code, notes, and snippets.

@kastman
Created January 14, 2014 21:02
Show Gist options
  • Save kastman/8425640 to your computer and use it in GitHub Desktop.
Save kastman/8425640 to your computer and use it in GitHub Desktop.
Really Simple Contact Form View
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>Contact Us</h1>
</div>
<p>We can help you answer questions and solve problems. Fill out the following form and we'll be in touch shortly:</p>
</div>
<div class="row">
<div class="col-md-12 well">
<div class="col-md-3 col-md-offset-1" id='contact-form'>
<%= simple_form_for(@contact, html: {class:'form-horizontal'}) do |f| %>
<% if @contact.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@contact.errors.count, "error") %> prohibited this contact from being saved:</h2>
<ul>
<% @contact.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<%= f.input :name, required: true %>
<%= f.input :email, required: true %>
<%= f.input :phone %>
<%= f.input :company, label: "Organization" %>
</div>
<div class="col-md-8">
<%= f.input :message, required: true, input_html: {cols: 60, :rows => 6} %>
<%= f.button :submit, class: 'button small btn-primary', id: 'contact-button' %>
</div>
</div>
</div>
<% end %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment