Created
January 15, 2018 15:00
-
-
Save aziflaj/cdd2b11e524a4454f7af3b519fe64077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def deep_search(key, params, found = nil) | |
return params.fetch(key) if params.has_key?(key) | |
params.each_pair do |_, v| | |
next unless v.is_a? ActionController::Parameters | |
found = deep_search(key, v) | |
end | |
found | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment