Previews

Pages

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<%# Select %>
<%= select_tag :fruits, options_for_select(["Apple", "Banana", "Blueberry", "Grapes", "Pineaple"]), class: "input" %>
<%# Select With Multiple %>
<%= select_tag :multiple_fruits, options_for_select(["Apple", "Banana", "Blueberry", "Grapes", "Pineaple"]), multiple: true, size: 3, class: "input" %>
<%# Select With Groups %>
<%= select_tag :cars, grouped_options_for_select({"American" => ["Ford", "Chevrolet", "Dodge"], "European" => ["BMW", "Mercedes-Benz", "Volkswagen"], "Asian" => ["Toyota", "Honda", "Nissan"]}), class: "input" %>
<%# Select With Separator %>
<select name="majors" id="majors" class="input">
<option value="">Select a major</option>
<hr>
<option value="arth">Art History</option>
<option value="finearts">Fine Arts</option>
<option value="gdes">Graphic Design</option>
<hr>
<option value="aeroeng">Aerospace Engineering</option>
<option value="biochemeng">Biochemical Engineering</option>
<option value="civileng">Civil Engineering</option>
</select>