- get "search" => "api/search#search_all", :as => "api_search"
- get "ways/search" => "api/search#search_ways"
- get "relations/search" => "api/search#search_relations"
- get "nodes/search" => "api/search#search_nodes"
-
- get "user/:id" => "users#api_read", :id => /\d+/
- get "user/details" => "users#api_details"
- get "user/gpx_files" => "users#api_gpx_files"
- get "users" => "users#api_users", :as => :api_users
-
- get "user/preferences" => "api/user_preferences#read"
- get "user/preferences/:preference_key" => "api/user_preferences#read_one"
- put "user/preferences" => "api/user_preferences#update"
- put "user/preferences/:preference_key" => "api/user_preferences#update_one"
- delete "user/preferences/:preference_key" => "api/user_preferences#delete_one"
-
- post "gpx/create" => "traces#api_create"
- get "gpx/:id" => "traces#api_read", :id => /\d+/
- put "gpx/:id" => "traces#api_update", :id => /\d+/
- delete "gpx/:id" => "traces#api_delete", :id => /\d+/
- get "gpx/:id/details" => "traces#api_read", :id => /\d+/
- get "gpx/:id/data" => "traces#api_data"
+ get "user/:id" => "api/users#show", :id => /\d+/, :as => :api_user
+ get "user/details" => "api/users#details"
+ get "user/gpx_files" => "api/users#gpx_files"
+ get "users" => "api/users#index", :as => :api_users
+
+ resources :user_preferences, :except => [:new, :create, :edit], :param => :preference_key, :path => "user/preferences", :controller => "api/user_preferences" do
+ collection do
+ put "" => "api/user_preferences#update_all", :as => ""
+ end
+ end
+
+ post "gpx/create" => "api/traces#create"
+ get "gpx/:id" => "api/traces#show", :as => :api_trace, :id => /\d+/
+ put "gpx/:id" => "api/traces#update", :id => /\d+/
+ delete "gpx/:id" => "api/traces#destroy", :id => /\d+/
+ get "gpx/:id/details" => "api/traces#show", :id => /\d+/
+ get "gpx/:id/data" => "api/traces#data", :as => :api_trace_data