summaryrefslogtreecommitdiff
path: root/app/helpers/namespaces_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-15 15:25:09 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-15 15:25:09 +0200
commitdcea191314c778331305d0926d6852fe04477115 (patch)
tree53be24b9be56998e6ca963db4c86394e39d1132c /app/helpers/namespaces_helper.rb
parent0759dd4513c0190b80058d4851e2bde36cbaede6 (diff)
downloadgitlab-ce-dcea191314c778331305d0926d6852fe04477115.tar.gz
Select2 tag for namespaces with ajax loading
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/namespaces_helper.rb')
-rw-r--r--app/helpers/namespaces_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index f7979c8b641..c363c7ffd74 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -16,4 +16,13 @@ module NamespacesHelper
grouped_options_for_select(options, selected)
end
+
+ def namespace_select_tag(id, opts = {})
+ css_class = "ajax-namespace-select "
+ css_class << "multiselect " if opts[:multiple]
+ css_class << (opts[:class] || '')
+ value = opts[:selected] || ''
+
+ hidden_field_tag(id, value, class: css_class)
+ end
end