Rails routes: GET without param :id
I'm developing a REST api based on rails. To use this api, you MUST be logged in. Regarding that, I'd like to create a method me in my user controller that will return a json of the logged in user infos. So, I don't need an :id to be passed in the URL. I just want to call http://domain.com/api/users/me So I tried this: namespace :api, defaults: { format: 'json' } do scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do resources :tokens, :only => [:create, :destroy] resources :users, :only => [:index, :update] do # I tried this match 'me', :via => :get # => api_user