This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdropdowns.txt
41 lines (34 loc) · 1.55 KB
/
dropdowns.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<%= collection_select(:book, :author_id, Author.all, :id, :name,
{ :include_blank => true }) %>
<%= collection_select(:adhoc_support, :company_id, Company.all, :id, :company_name,
{ :include_blank => true }) %>
<%= f.label "Company" %>
<select id="adhoc_supports_company_id" name="adhoc_support[company_id]">
<% if @adhoc_support.company_id == 0 or @adhoc_support.company_id == nil %>
<option value="Please select a company" selected="selected" ></option>
<% end %>
<% @item = Company.find(:all, :order => "company_name") @item.each do |item| %>
<option value="<%= item.company_name %>"
<% if @adhoc_support.company_id == item.id -%> selected="selected" <% end %>
<%= item.company_name %>
</option>
<% end %>
</select>
<%= f.label "Company" %>
<select id="adhoc_supports_company_id" name="adhoc_support[company_id]">
<% if @adhoc_support.company_id == 0 or @adhoc_support.company_id == nil %>
<option value="Please select a company" selected="selected" ></option>
<% end %>
<% @item = Company.find(:all, :order => "company_name") @item.each do |item| %>
<option value="<%= item.company_name %>">
<% if @adhoc_support.company_id == item.id -%> selected="selected" <% end %>
<%= item.company_name %>
</option>
<% end %>
</select>
<!-- <%= if can? :update, @company %> -->
<td><%= link_to 'Show', company %></td>
<!-- <% end%>-->
<%= if can? :destroy, @company %>
<td><%= link_to 'Delete', company, :method => :delete, :confirm => 'Are you sure?', :title => "Delete #{company.company_name}" %></td>
<% end %>