Last active
August 29, 2015 14:08
-
-
Save maxehmookau/a02fdd2c277fcbb562e4 to your computer and use it in GitHub Desktop.
DRY up routes using methods in routes.rb
This file contains hidden or 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
Rails.application.routes.draw do | |
api_read_actions = [:index, :show] | |
api_resources = [:videos, :people, :collections] | |
api_resources.each do |api_resource| | |
resources api_resource, only: api_read_actions | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment