diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-08-18 04:19:57 -0700 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-09-06 17:33:46 -0700 |
commit | 1993a4449a5be44acfa5a9e1a94842e05da5edd5 (patch) | |
tree | 80a38bd0b427a5baf7ca36a3a71f8eb75c9d912f /app/helpers/dropdowns_helper.rb | |
parent | 07d5ee361a438fcfff28fe184bbec2aa98ce5d14 (diff) | |
download | gitlab-ce-1993a4449a5be44acfa5a9e1a94842e05da5edd5.tar.gz |
Enable frozen string for app/helpers/**/*.rb
Partially addresses #47424.
Diffstat (limited to 'app/helpers/dropdowns_helper.rb')
-rw-r--r-- | app/helpers/dropdowns_helper.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/helpers/dropdowns_helper.rb b/app/helpers/dropdowns_helper.rb index 5a2360b4661..4b6c5b215e8 100644 --- a/app/helpers/dropdowns_helper.rb +++ b/app/helpers/dropdowns_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DropdownsHelper def dropdown_tag(toggle_text, options: {}, &block) content_tag :div, class: "dropdown #{options[:wrapper_class] if options.key?(:wrapper_class)}" do @@ -10,7 +12,7 @@ module DropdownsHelper dropdown_output = dropdown_toggle(toggle_text, data_attr, options) dropdown_output << content_tag(:div, class: "dropdown-menu dropdown-select #{options[:dropdown_class] if options.key?(:dropdown_class)}") do - output = "" + output = [] if options.key?(:title) output << dropdown_title(options[:title]) @@ -31,8 +33,7 @@ module DropdownsHelper end output << dropdown_loading - - output.html_safe + output.join.html_safe end dropdown_output.html_safe @@ -50,7 +51,7 @@ module DropdownsHelper def dropdown_title(title, options: {}) content_tag :div, class: "dropdown-title" do - title_output = "" + title_output = [] if options.fetch(:back, false) title_output << content_tag(:button, class: "dropdown-title-button dropdown-menu-back", aria: { label: "Go back" }, type: "button") do @@ -66,7 +67,7 @@ module DropdownsHelper end end - title_output.html_safe + title_output.join.html_safe end end |