get "gpx/:id/data" => "api/traces#data", :as => :api_trace_data
# Map notes API
- resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :defaults => { :format => "xml" }, :controller => "api/notes" do
+ resources :notes, :except => [:new, :edit, :update], :constraints => { :id => /\d+/ }, :controller => "api/notes", :as => :api_notes do
collection do
get "search"
get "feed", :defaults => { :format => "rss" }
get "/relation/:id/history" => "browse#relation_history", :id => /\d+/, :as => :relation_history
get "/changeset/:id" => "browse#changeset", :as => :changeset, :id => /\d+/
get "/changeset/:id/comments/feed" => "changeset_comments#index", :as => :changeset_comments_feed, :id => /\d*/, :defaults => { :format => "rss" }
- get "/note/:id" => "browse#note", :id => /\d+/, :as => "browse_note"
- get "/note/new" => "browse#new_note"
+ resources :notes, :path => "note", :only => [:show, :new]
+
get "/user/:display_name/history" => "changesets#index"
get "/user/:display_name/history/feed" => "changesets#feed", :defaults => { :format => :atom }
get "/user/:display_name/notes" => "notes#index", :as => :user_notes
get "/help" => "site#help"
get "/about/:about_locale" => "site#about"
get "/about" => "site#about"
+ get "/communities" => "site#communities"
get "/history" => "changesets#index"
get "/history/feed" => "changesets#feed", :defaults => { :format => :atom }
get "/history/comments/feed" => "changeset_comments#index", :as => :changesets_comments_feed, :defaults => { :format => "rss" }
# traces
resources :traces, :except => [:show]
- get "/user/:display_name/traces/tag/:tag/page/:page" => "traces#index", :page => /[1-9][0-9]*/
+ get "/user/:display_name/traces/tag/:tag/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/traces/tag/%{tag}")
get "/user/:display_name/traces/tag/:tag" => "traces#index"
- get "/user/:display_name/traces/page/:page" => "traces#index", :page => /[1-9][0-9]*/
+ get "/user/:display_name/traces/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/traces")
get "/user/:display_name/traces" => "traces#index"
get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss }
get "/user/:display_name/traces/:id" => "traces#show", :as => "show_trace"
get "/user/:display_name/traces/:id/picture" => "traces#picture", :as => "trace_picture"
get "/user/:display_name/traces/:id/icon" => "traces#icon", :as => "trace_icon"
- get "/traces/tag/:tag/page/:page" => "traces#index", :page => /[1-9][0-9]*/
+ get "/traces/tag/:tag/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces/tag/%{tag}")
get "/traces/tag/:tag" => "traces#index"
- get "/traces/page/:page" => "traces#index", :page => /[1-9][0-9]*/
+ get "/traces/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces")
get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
get "/traces/rss" => "traces#georss", :defaults => { :format => :rss }
- get "/traces/mine/tag/:tag/page/:page" => "traces#mine", :page => /[1-9][0-9]*/
+ get "/traces/mine/tag/:tag/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces/mine/tag/%{tag}")
get "/traces/mine/tag/:tag" => "traces#mine"
- get "/traces/mine/page/:page" => "traces#mine"
+ get "/traces/mine/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces/mine")
get "/traces/mine" => "traces#mine"
get "/trace/create", :to => redirect(:path => "/traces/new")
get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
get "/user/:display_name/diary" => "diary_entries#index"
get "/diary/:language" => "diary_entries#index"
scope "/user/:display_name" do
- resources :diary_entries, :path => "diary", :only => [:edit, :update, :show]
+ resources :diary_entries, :path => "diary", :only => [:edit, :update, :show], :id => /\d+/
end
post "/user/:display_name/diary/:id/newcomment" => "diary_entries#comment", :id => /\d+/, :as => :comment_diary_entry
post "/user/:display_name/diary/:id/hide" => "diary_entries#hide", :id => /\d+/, :as => :hide_diary_entry
# geocoder
get "/search" => "geocoder#search"
- get "/geocoder/search_latlon" => "geocoder#search_latlon"
- get "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode"
- get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
- get "/geocoder/search_geonames" => "geocoder#search_geonames"
- get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
- get "/geocoder/search_geonames_reverse" => "geocoder#search_geonames_reverse"
+ post "/geocoder/search_latlon" => "geocoder#search_latlon"
+ post "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
+ post "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
# directions
get "/directions" => "directions#search"