X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6094a97ce6297d390e5bbf733f5c2b4cc6b2076c..3b0748831aa249b2beeb593641dfec06f980b6c8:/config/routes.rb diff --git a/config/routes.rb b/config/routes.rb index 89e636409..ccc32c773 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -71,22 +71,21 @@ OpenStreetMap::Application.routes.draw do get "user/details" => "users#details" get "user/gpx_files" => "users#gpx_files" get "users" => "users#index", :as => :api_users + end - resources :user_preferences, :except => [:new, :create, :edit], :param => :preference_key, :path => "user/preferences", :controller => "user_preferences" do + namespace :api, :path => "api/0.6" 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 +125,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 +257,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 @@ -331,8 +332,7 @@ OpenStreetMap::Application.routes.draw do # banning pages get "/user/:display_name/blocks" => "user_blocks#blocks_on", :as => "user_blocks_on" get "/user/:display_name/blocks_by" => "user_blocks#blocks_by", :as => "user_blocks_by" - get "/blocks/new/:display_name" => "user_blocks#new", :as => "new_user_block" - resources :user_blocks, :except => :new + resources :user_blocks, :path_names => { :new => "new/:display_name" } match "/user/:display_name/blocks/revoke_all" => "user_blocks#revoke_all", :via => [:get, :post], :as => "revoke_all_user_blocks" # issues and reports