Advertisement
Guest User

Untitled

a guest
May 27th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <%= form_tag dispatch_call_call_path(call), :class => "dispatch-form-tag" do %>
  2. <%= select_tag(:unit_ids, options_from_collection_for_select(Unit.active.order("unit_name ASC"), "id", "unit_name"), :include_blank => true, :required => true, :class => 'select' )%>
  3. <%= button_tag 'Dispatch', class: 'btn btn-danger btn-small', data: {disable_with: "<i class='icon-spinner'></i>Processing..."} %>
  4. <% end %>
  5.  
  6. def unit_select
  7. Unit.active.order("unit_name").map{|unit| unit.calls.where(call_status: "open").empty? ? ["#{unit.unit_name} #{unit.unit_type.unit_type}", unit.id] : ["#{unit.unit_name} (on call) #{unit.unit_type.unit_type}", unit.id] }
  8. end
  9.  
  10. <%= f.select(:unit_ids, unit_select, {}, {:multiple => true, :class => 'select'}) %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement