instance method
rename_key
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
rename_key(key, options = {})
No documentation comment.
Parameters
-
keyreq -
optionsopt = {}
Source
# File activesupport/lib/active_support/core_ext/hash/conversions.rb, line 161
def rename_key(key, options = {})
camelize = options.has_key?(:camelize) ? options[:camelize] : ActiveSupport.camelize_xml
dasherize = options.has_key?(:dasherize) ? options[:dasherize] : ActiveSupport.dasherize_xml
key = key.camelize if camelize
key = key.dasherize if dasherize
key
end
Defined in activesupport/lib/active_support/core_ext/hash/conversions.rb line 161
· View on GitHub
· Improve this page
· Find usages on GitHub