Skip to content

Instantly share code, notes, and snippets.

@thelastinuit
Last active August 29, 2015 14:02
Show Gist options
  • Save thelastinuit/b12bb24f71156d312a8e to your computer and use it in GitHub Desktop.
Save thelastinuit/b12bb24f71156d312a8e to your computer and use it in GitHub Desktop.
Better API
# http://api.awesomeurl.com/generalresource.json
# http://api.awesomeurl.com/v1/resource.json
# http://api.awesomeurl.com/v2/resource.json
namespace :api, :path => "", :constraints => {:subdomain => "api"}, :defaults => {:format => :json} do
resources :generalresource
namespace :v1 do
resources :resource
end
namespace :v2 do
resources :resource
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment