diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2018-03-20 14:17:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-20 14:17:35 +0000 |
commit | c7cbc2e3a074fa22f5ec030f2118dff0c42598ef (patch) | |
tree | 9ac8f6a111fbe9a8218baaa768b42cda64bb980a /actionview/lib | |
parent | 7f71a6a6e35d1d7c547fc8158697cc888a7b3aea (diff) | |
parent | 8e095d699e9e6e626bdc53db7f756cf478a2c48c (diff) | |
download | rails-c7cbc2e3a074fa22f5ec030f2118dff0c42598ef.tar.gz rails-c7cbc2e3a074fa22f5ec030f2118dff0c42598ef.tar.bz2 rails-c7cbc2e3a074fa22f5ec030f2118dff0c42598ef.zip |
Merge pull request #32302 from q-centrix/perf-improvement-tag-name
Interpolate '' instead of nil when multiple is false.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/tags/base.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/tags/base.rb b/actionview/lib/action_view/helpers/tags/base.rb index f1eca2268a..eef527d36f 100644 --- a/actionview/lib/action_view/helpers/tags/base.rb +++ b/actionview/lib/action_view/helpers/tags/base.rb @@ -109,11 +109,11 @@ module ActionView # a little duplication to construct less strings case when @object_name.empty? - "#{sanitized_method_name}#{"[]" if multiple}" + "#{sanitized_method_name}#{multiple ? "[]" : ""}" when index - "#{@object_name}[#{index}][#{sanitized_method_name}]#{"[]" if multiple}" + "#{@object_name}[#{index}][#{sanitized_method_name}]#{multiple ? "[]" : ""}" else - "#{@object_name}[#{sanitized_method_name}]#{"[]" if multiple}" + "#{@object_name}[#{sanitized_method_name}]#{multiple ? "[]" : ""}" end end |