Created
January 28, 2016 13:09
-
-
Save gmaliar/b539a08d30bb567bb5e7 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
# routes.rb | |
namespace :api do | |
Dir[Rails.root.join("app", "controllers", "api", "*_controller.rb")].map { |file| file.match(/app\/controllers\/api\/([[:alpha:]]+)_controller\.rb/)[1].pluralize }.each |ctrl| | |
resources ctrl.to_sym | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment