Skip to content

Instantly share code, notes, and snippets.

@raphox
Created May 15, 2014 20:53
Show Gist options
  • Save raphox/e03eaf46f8822b05ad23 to your computer and use it in GitHub Desktop.
Save raphox/e03eaf46f8822b05ad23 to your computer and use it in GitHub Desktop.
routes format default
Rails.application.routes.draw do
...
namespace :api, defaults: {format: 'json'} do
namespace :v1 do
resources :products, only: [:index, :show]
match "/products" => "products#index", via: :options
end
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment