diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-15 15:25:09 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-15 15:25:09 +0200 |
commit | dcea191314c778331305d0926d6852fe04477115 (patch) | |
tree | 53be24b9be56998e6ca963db4c86394e39d1132c /app/helpers/namespaces_helper.rb | |
parent | 0759dd4513c0190b80058d4851e2bde36cbaede6 (diff) | |
download | gitlab-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.rb | 9 |
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 |