Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created November 7, 2015 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2d73ce3dc30995a0094a to your computer and use it in GitHub Desktop.
Save anonymous/2d73ce3dc30995a0094a to your computer and use it in GitHub Desktop.
I heard you like hashes...
# Found at the bottom of the App Controller
def hash2hash(hash, *keys)
hash = {} unless hash.is_a?(Hash)
keys.each {|key|
hash = hash[key]
hash = {} unless hash.is_a?(Hash)
}
hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment