%= form_for @resource, :html => { :multipart => true, class: "col-sm-6" } do |f| %> <% if @resource.errors.any? %>
<%= f.label :resource_category_id, "Category" %>
<%= select(:resource, :resource_category_id, options_from_collection_for_select(ResourceCategory.all.sort_by(&:name), :id, :name, @resource.resource_category_id ), {}, {class: "form-control"} ) %>
<%= f.label :name %>
<%= f.text_field :name, class: "form-control" %>
<%= f.label :serial, "Serial" %>
<%= f.text_field :serial, class: "form-control" %>
<%= f.label :specs, "Specs" %>
<%= f.text_field :specs, class: "form-control" %>
<%= f.label :status, "Status/Location" %>
<%= f.text_field :status, class: "form-control" %>
<%= f.label :disposed_at, "Disposed?" %>
<%= f.date_select :disposed_at, include_blank: true %>
<%= f.label :user_id, "Owner" %>
<%= select(:resource, :user_id, options_from_collection_for_select(@users, :id, :name, @resource.user_id), {include_blank: true}, {class: "form-control"}) %>
<%= f.label :donatable %>
<%= f.check_box :donatable %>
<%= f.label :estimated_value, "Estimated Value" %>
<%= f.text_field :estimated_value, class: "form-control" %>
<%= f.label p %>
<%= f.file_field p %>
<%= link_to image_tag(@resource.send(p).url(:tiny)), @resource.send(p).url unless @resource.send(p).blank? %>
<%= f.label :notes %>
<%= f.text_area :notes, class: "form-control" %>
<%= f.submit nil, class: "btn btn-primary" %>
<% end %>