From e542a3056c27fd662ef767b6720861035f6dbb1c Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 18 May 2016 21:00:42 +0200 Subject: api: set defaults for version in routes This way we do not need to specify it all the times. In the functional tests defaults do not get added automatically. Introduced api_{get,put,post,delete} to add format and version default. One to two functional tests failing, everything else passes. --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index a1a5b3c..7fbedf2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,7 +26,7 @@ LeapWeb::Application.routes.draw do namespace "api", { module: "api", path: "/:version/", - defaults: {format: 'json'}, + defaults: {version: '2', format: 'json'}, :constraints => { :id => /[^\/]+(?=\.json\z)|[^\/]+/, :version => /[12]/ } } do resources :sessions, :only => [:new, :create, :update] -- cgit v1.2.3