Commit 4a46d053 authored by Alex Kalderimis's avatar Alex Kalderimis

Prefer fetch to nil check

This also prevents items and selected being ovewritten by keys in data.
parent 7551495a
...@@ -47,7 +47,7 @@ module ListboxHelper ...@@ -47,7 +47,7 @@ module ListboxHelper
end end
classes = [*DROPDOWN_CONTAINER_CLASSES, *html_options[:class]] classes = [*DROPDOWN_CONTAINER_CLASSES, *html_options[:class]]
data = { items: items, selected: selected }.merge(html_options[:data] || {}) data = html_options.fetch(:data, {}).merge(items: items, selected: selected)
content_tag(:div, button, html_options.merge({ content_tag(:div, button, html_options.merge({
class: classes, class: classes,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment