Skip to content

Instantly share code, notes, and snippets.

@vdmgolub
Created July 22, 2013 12:10
Show Gist options
  • Save vdmgolub/6053379 to your computer and use it in GitHub Desktop.
Save vdmgolub/6053379 to your computer and use it in GitHub Desktop.
API versioning with constraints
namespace :api do
constrants ApiVersion.new(1) do
scope :module => :v1 do
resource :app do
resources :indices
end
end
end
constraints ApiVersion.new(2) do
scope :module => :v2
resource :app do
resources :indices
end
end
end
match "/*path", to: "errors#unsupported_version", via: :all
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment