Created
August 1, 2016 17:19
-
-
Save camkidman/2afc9dd583a1d4df099b3688e160814b 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
## | |
# Given the format [{"controller" => ["action0", "action1"]}, ... ] | |
# this gist should output a "get" method for everything that was there previously. | |
# | |
# ... Curse you, rails dynamic routing. | |
array_of_route_hashes = _ | |
array_of_route_hashes.each do |hash| | |
hash.each do |controller, action_hash| | |
action_hash.each do |action| | |
puts "get '#{controller}/#{action}', :to => '#{controller}##{action}', :as => '#{controller}/#{action}'" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment