mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Extract data/aria attribute prefixes to a constant
This commit is contained in:
parent
a794fd2c0a
commit
faa0f32434
1 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,8 @@ module ActionView
|
||||||
|
|
||||||
BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attribute| attribute.to_sym })
|
BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attribute| attribute.to_sym })
|
||||||
|
|
||||||
|
TAG_PREFIXES = ['aria', 'data', :aria, :data].to_set
|
||||||
|
|
||||||
PRE_CONTENT_STRINGS = {
|
PRE_CONTENT_STRINGS = {
|
||||||
:textarea => "\n"
|
:textarea => "\n"
|
||||||
}
|
}
|
||||||
|
@ -148,7 +150,7 @@ module ActionView
|
||||||
return if options.blank?
|
return if options.blank?
|
||||||
attrs = []
|
attrs = []
|
||||||
options.each_pair do |key, value|
|
options.each_pair do |key, value|
|
||||||
if (key.to_s == 'data' || key.to_s == 'aria') && value.is_a?(Hash)
|
if TAG_PREFIXES.include?(key) && value.is_a?(Hash)
|
||||||
value.each_pair do |k, v|
|
value.each_pair do |k, v|
|
||||||
attrs << prefix_tag_option(key, k, v, escape)
|
attrs << prefix_tag_option(key, k, v, escape)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue