Railsã«ã¯Hash#symbolize_keysã¨ããã¡ã½ãããç¨æããã¦ãããHashã®ãã¼ãæååããã·ã³ãã«ã«ãã¦ãããã®ã§ãããã§å®å¿ã ã¼ãªãã¦æã£ã¦ãã¨ãããã·ã¥ã®ä¸èº«ãã·ã³ãã«ã«ãªããªãã£ãããããå ·ä½çã«ã¯ { 'key': 1 'hash': { 'key': 2 } }.symbolize_keys # => { key: 1 hash: { 'key': 2 } } ã¿ãããªäºã«ãªãããããå帰çã«ãããã®ã§ãªãã¨ããããã¨ããæ㯠class Hash def symbolize_keys! keys.each do |key| case (v = delete(key)) when Hash v = v.symbolize_keys when Array v = v.map{|x| (x.symbolize_keys rescue x) } end self[(
{{#tags}}- {{label}}
{{/tags}}