From 87f69d64dbaf73bb4e30749a52b69a951ca3fabe Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 31 Jan 2013 15:20:25 -0800 Subject: [PATCH] add /users/current method --- app/controllers/orvos/v1/users_controller.rb | 4 ++++ config/routes.rb | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/orvos/v1/users_controller.rb b/app/controllers/orvos/v1/users_controller.rb index 57ce13bbb9..7fc0f47d49 100644 --- a/app/controllers/orvos/v1/users_controller.rb +++ b/app/controllers/orvos/v1/users_controller.rb @@ -1,2 +1,6 @@ class Orvos::V1::UsersController < ApplicationController + def current + @object = current_user + show + end end diff --git a/config/routes.rb b/config/routes.rb index 648297685e..a25f86373f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -69,6 +69,10 @@ Server::Application.routes.draw do namespace :orvos do namespace :v1 do + match '/schema' => 'schema#show' + match '/nodes/:uuid/ping' => 'nodes#ping', :as => :ping_node + match '/links/from/:tail_uuid' => 'links#index', :as => :orvos_v1_links_from + match '/users/current' => 'users#current' resources :collections resources :links resources :nodes @@ -79,9 +83,6 @@ Server::Application.routes.draw do resources :projects resources :logs resources :users - match '/schema' => 'schema#show' - match '/nodes/:uuid/ping' => 'nodes#ping', :as => :ping_node - match '/links/:tail_uuid' => 'links#index' end end -- 2.30.2