X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7d4cc85a312cb79fd1c4b0f22626722bea1d736d..b31ac7430e86b9661b836269162d4c57d3c2d1fb:/config/routes.rb diff --git a/config/routes.rb b/config/routes.rb index 4d3c1bf55..b8689256d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -67,26 +67,26 @@ OpenStreetMap::Application.routes.draw do get "trackpoints" => "tracepoints#index" - get "user/:id" => "users#show", :id => /\d+/, :as => :api_user get "user/details" => "users#details" get "user/gpx_files" => "users#gpx_files" - get "users" => "users#index", :as => :api_users + end + + namespace :api, :path => "api/0.6" do + resources :users, :only => :index + resources :users, :path => "user", :id => /\d+/, :only => :show - resources :user_preferences, :except => [:new, :create, :edit], :param => :preference_key, :path => "user/preferences", :controller => "user_preferences" do + resources :user_preferences, :except => [:new, :create, :edit], :param => :preference_key, :path => "user/preferences" do collection do put "" => "user_preferences#update_all", :as => "" end end - end - namespace :api, :path => "api/0.6" do - resources :messages, :path => "user/messages", :constraints => { :id => /\d+/ }, :only => [:create, :show, :update, :destroy] do - collection do - get "inbox" - get "outbox" - end + resources :messages, :path => "user/messages", :constraints => { :id => /\d+/ }, :only => [:create, :show, :update, :destroy] + namespace :messages, :path => "user/messages" do + resource :inbox, :only => :show + resource :outbox, :only => :show end - post "/user/messages/:id" => "messages#update" + post "/user/messages/:id" => "messages#update", :as => nil resources :traces, :path => "gpx", :only => [:create, :show, :update, :destroy], :id => /\d+/ do scope :module => :traces do @@ -126,7 +126,8 @@ OpenStreetMap::Application.routes.draw do get "/relation/:id/history" => "old_relations#index", :id => /\d+/, :as => :relation_history resources :old_relations, :path => "/relation/:id/history", :id => /\d+/, :version => /\d+/, :param => :version, :only => :show resources :changesets, :path => "changeset", :id => /\d+/, :only => :show do - match :subscribe, :unsubscribe, :on => :member, :via => [:get, :post] + match :subscribe, :on => :member, :via => [:get, :post] + match :unsubscribe, :on => :member, :via => [:get, :post] namespace :changeset_comments, :as => :comments, :path => :comments do resource :feed, :only => :show, :defaults => { :format => "rss" } @@ -257,7 +258,8 @@ OpenStreetMap::Application.routes.draw do scope "/user/:display_name" do resources :diary_entries, :path => "diary", :only => [:edit, :update, :show], :id => /\d+/ do member do - post :hide, :unhide + post :hide + post :unhide end end end @@ -288,8 +290,9 @@ OpenStreetMap::Application.routes.draw do match "/user/:display_name/remove_friend" => "friendships#remove_friend", :via => [:get, :post], :as => "remove_friend" # user lists - match "/users" => "users#index", :via => [:get, :post] - match "/users/:status" => "users#index", :via => [:get, :post] + namespace :users do + resource :list, :path => "(:status)", :only => [:show, :update] + end # geocoder get "/search" => "geocoder#search"