Commit 67f99b16dee00d34ba52c1446ce3748ba236ee86
1 parent
8f2bf863
Exists in
master
and in
5 other branches
software_search: Add the Any option for the select boxes.
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
lib/controlled_vocabulary_helper.rb
1 | 1 | module ControlledVocabularyHelper |
2 | 2 | |
3 | 3 | def self.get_categories_as_options |
4 | - categories = [] | |
4 | + categories = ["<option>Any</option>".html_safe] | |
5 | 5 | |
6 | 6 | ControlledVocabulary.attribute_names.each do |attribute| |
7 | 7 | if attribute.to_s != "id" && attribute.to_s != "software_info_id" then | ... | ... |
views/search/search_forms/_software_fields.html.erb
... | ... | @@ -7,28 +7,28 @@ |
7 | 7 | <tr> |
8 | 8 | <td> <%= _("Database") %> </td> |
9 | 9 | <td> |
10 | - <%= select_tag("database_description", SoftwareHelper.select_options(DatabaseDescription.all)) %> | |
10 | + <%= collection_select(:database_description, :id, DatabaseDescription.all, :id, :name, :prompt=>_("Any")) %> | |
11 | 11 | </td> |
12 | 12 | </tr> |
13 | 13 | |
14 | 14 | <tr> |
15 | 15 | <td> <%= _("Programming Language") %> </td> |
16 | 16 | <td> |
17 | - <%= select_tag("programming_language", SoftwareHelper.select_options(ProgrammingLanguage.all)) %> | |
17 | + <%= collection_select(:programming_language, :id, ProgrammingLanguage.all, :id, :name, :prompt=>_("Any")) %> | |
18 | 18 | </td> |
19 | 19 | </tr> |
20 | 20 | |
21 | 21 | <tr> |
22 | 22 | <td> <%= _("Operating System") %> </td> |
23 | 23 | <td> |
24 | - <%= select_tag("operating_system", SoftwareHelper.select_options(OperatingSystemName.all)) %> | |
24 | + <%= collection_select(:operating_system, :id, OperatingSystemName.all, :id, :name, :prompt=>_("Any")) %> | |
25 | 25 | </td> |
26 | 26 | </tr> |
27 | 27 | |
28 | 28 | <tr> |
29 | 29 | <td> <%= _("Controlled Vocabulary") %> </td> |
30 | 30 | <td> |
31 | - <%= select_tag("controlled_vocabulary", ControlledVocabularyHelper.get_categories_as_options) %> | |
31 | + <%= select_tag("controlled_vocabulary", (ControlledVocabularyHelper.get_categories_as_options)) %> | |
32 | 32 | </td> |
33 | 33 | </tr> |
34 | 34 | ... | ... |