aboutsummaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/resources_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/resources_helper.rb b/app/helpers/resources_helper.rb
index a949311..792a78a 100644
--- a/app/helpers/resources_helper.rb
+++ b/app/helpers/resources_helper.rb
@@ -4,13 +4,14 @@
module ResourcesHelper
# Return a SELECT tag to choose a section in a given taxonomy
- def section_select(taxonomy, selected = nil)
+ def section_select(taxonomy, selected = nil, options = {})
grouped_options = []
+ tag_name = options[:name] || 'classification[section_ids]'
taxonomy.categories.each do |c|
grouped_options << [c.name, c.sections.map { |s| [s.name, s.id] }]
end
- select_tag('classification[section_ids]', grouped_options_for_select(grouped_options), selected: selected, multiple: true)
+ select_tag(tag_name, grouped_options_for_select(grouped_options, selected), multiple: true)
end
end