Commit 52915c62a511403cd0df2baecad2f08f0c1de804
1 parent
ed4e22e2
Exists in
master
and in
79 other branches
software_search: Add value to vocabulary helper
Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com> Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Showing
1 changed file
with
4 additions
and
3 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 = ["<option>Any</option>".html_safe] | |
4 | + categories = ["<option value = #{""} >Any</option>".html_safe] | |
5 | + value = 1 | |
5 | 6 | |
6 | 7 | ControlledVocabulary.attribute_names.each do |attribute| |
7 | 8 | if attribute.to_s != "id" && attribute.to_s != "software_info_id" then |
8 | - categories << "<option>#{attribute.titleize}</option>".html_safe | |
9 | + categories << "<option value = #{attribute} >#{attribute.titleize}</option>".html_safe | |
10 | + value+=1 | |
9 | 11 | end |
10 | 12 | end |
11 | - | |
12 | 13 | categories |
13 | 14 | end |
14 | 15 | end | ... | ... |