X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e41814d1395803bdb46bfa4db88424be9d47071f..c7e038a4d098ef9f42eb13edf29aef24cbd537ef:/config/routes.rb diff --git a/config/routes.rb b/config/routes.rb index 0467c59c8..58d629d69 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,13 +80,12 @@ OpenStreetMap::Application.routes.draw do end end - 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 @@ -306,16 +307,16 @@ OpenStreetMap::Application.routes.draw do get "/export/embed" => "export#embed" # messages - resources :messages, :only => [:create, :show, :destroy] do + resources :messages, :id => /\d+/, :only => [:create, :show, :destroy] do post :mark patch :unmute match :reply, :via => [:get, :post] - collection do - get :inbox - get :muted - get :outbox - end + end + namespace :messages, :path => "/messages" do + resource :inbox, :only => :show + resource :muted_inbox, :path => "muted", :only => :show + resource :outbox, :only => :show end get "/user/:display_name/inbox", :to => redirect(:path => "/messages/inbox") get "/user/:display_name/outbox", :to => redirect(:path => "/messages/outbox")