Open-Source-Access-Control-.../app/views/resources/_form.html.erb

74 lines
1.9 KiB
Plaintext
Raw Normal View History

2014-02-09 10:42:17 +00:00
<%= form_for @resource, :html => { :multipart => true } do |f| %>
<% if @resource.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@resource.errors.count, "error") %> prohibited this resource from being saved:</h2>
<ul>
<% @resource.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<p>
<%= f.label :resource_category_id, "Category" %><br />
<%= select(:resource, :resource_category_id, options_from_collection_for_select(ResourceCategory.all.sort_by(&:name), :id, :name, @resource.resource_category_id ) ) %>
2014-02-09 10:42:17 +00:00
</p>
<p>
<%= f.label :name %><br />
<%= f.text_field :name %>
</p>
<p>
<%= f.label :serial, "Serial" %>
<br />
<%= f.text_field :serial %>
</p>
<p>
<%= f.label :specs, "Specs" %>
<br/>
<%= f.text_field :specs %>
</p>
<p>
<%= f.label :status, "Status/Location" %>
<br/>
<%= f.text_field :status %>
</p>
2014-02-09 11:32:45 +00:00
<p>
<%= f.label :disposed_at, "Disposed?" %><br />
<%= f.date_select :disposed_at, include_blank: true %>
</p>
2014-02-09 10:42:17 +00:00
<p>
<%= f.label :user_id, "Owner" %>
<br />
<%= select(:resource, :user_id, options_from_collection_for_select(@users, :id, :name, @resource.user_id), include_blank: true) %>
</p>
<p>
<%= f.label :donatable %><br />
<%= f.check_box :donatable %>
</p>
<p>
<%= f.label :estimated_value, "Estimated Value" %><br />
<%= f.text_field :estimated_value %>
</p>
<p>
<%= f.label :picture %><br />
<%= f.file_field :picture %>
<%= link_to image_tag(@resource.picture.url(:tiny)), @resource.picture.url, :popup => ['form_image_preview', 'height=300,width=400'] if @resource.picture? %>
</p>
<p>
<%= f.label :notes %><br />
<%= f.text_area :notes %>
</p>
<p>
<%= f.submit %>
</p>
<% end %>
<%= link_to 'Back', resources_path %>