2014-02-27 11:13:53 +00:00
|
|
|
<%= form_for(@contract, html: {class: "col-sm-6"}) do |f| %>
|
|
|
|
<% if @contract.errors.any? %>
|
|
|
|
<div id="error_explanation">
|
|
|
|
<h2><%= pluralize(@contract.errors.count, "error") %> prohibited this contract from being saved:</h2>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<% @contract.errors.full_messages.each do |msg| %>
|
|
|
|
<li><%= msg %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2014-03-03 02:06:39 +00:00
|
|
|
<div class="form-group">
|
2014-02-27 11:13:53 +00:00
|
|
|
<%= f.label :first_name %><br />
|
|
|
|
<%= f.text_field :first_name, class: "form-control" %>
|
2014-03-03 02:06:39 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2014-02-27 11:13:53 +00:00
|
|
|
<%= f.label :last_name %><br />
|
|
|
|
<%= f.text_field :last_name, class: "form-control" %>
|
2014-03-03 02:06:39 +00:00
|
|
|
</div>
|
2014-03-03 04:48:49 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label :cosigner %><br />
|
|
|
|
<%= f.text_field :cosigner, class: "form-control" %>
|
|
|
|
</div>
|
2014-02-27 11:13:53 +00:00
|
|
|
|
2014-03-03 02:06:39 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label :user_id, "User" %><br />
|
|
|
|
<%= collection_select(:contract, :user_id, @users, :id, :name, :include_blank => true) %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2014-02-27 11:13:53 +00:00
|
|
|
<%= f.label :signed_at %><br />
|
2014-03-03 02:06:39 +00:00
|
|
|
<%= f.date_select :signed_at %>
|
|
|
|
</div>
|
2014-02-27 11:13:53 +00:00
|
|
|
|
2014-03-03 02:06:39 +00:00
|
|
|
<div class="form-group">
|
2014-02-27 11:13:53 +00:00
|
|
|
<%= f.label :document %><br />
|
2014-03-03 04:48:49 +00:00
|
|
|
<%= link_to "View Existing Document", @contract.document.url, class: "btn btn-default" unless @contract.document.blank? %>
|
|
|
|
<p>
|
|
|
|
<%= link_to "Upload New Document", "#", class: "btn btn-default", onclick: "$('#document_upload').removeClass('hidden'); $(this).addClass('hidden')" unless @contract.document.blank? %>
|
|
|
|
<div id="document_upload" class="<%= "hidden" unless @contract.document.blank? %>">
|
|
|
|
<%= f.file_field :document %>
|
|
|
|
</div>
|
|
|
|
</p>
|
2014-03-03 02:06:39 +00:00
|
|
|
</div>
|
2014-02-27 11:13:53 +00:00
|
|
|
|
2014-03-03 02:06:39 +00:00
|
|
|
<div class="form-group">
|
2014-02-27 11:13:53 +00:00
|
|
|
<%= f.submit nil, class: "btn btn-primary" %>
|
2014-03-03 02:06:39 +00:00
|
|
|
</div>
|
2014-02-27 11:13:53 +00:00
|
|
|
<% end %>
|