]> git.openstreetmap.org Git - rails.git/blob - config/routes.rb
lots of rails gpx stuff
[rails.git] / config / routes.rb
1 ActionController::Routing::Routes.draw do |map|
2
3   # API
4   API_VERSION = '0.4' # change this in envronment.rb too
5   map.connect "api/#{API_VERSION}/node/create", :controller => 'node', :action => 'create'
6   map.connect "api/#{API_VERSION}/node/:id/history", :controller => 'old_node', :action => 'history', :id => nil
7   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'rest', :id => nil
8   map.connect "api/#{API_VERSION}/nodes", :controller => 'node', :action => 'nodes', :id => nil
9   
10   map.connect "api/#{API_VERSION}/segment/create", :controller => 'segment', :action => 'create'
11   map.connect "api/#{API_VERSION}/segment/:id/history", :controller => 'old_segment', :action => 'history'
12   map.connect "api/#{API_VERSION}/segment/:id", :controller => 'segment', :action => 'rest'
13   map.connect "api/#{API_VERSION}/segments", :controller => 'segment', :action => 'segments', :id => nil
14   
15   map.connect "api/#{API_VERSION}/way/create", :controller => 'way', :action => 'create'
16   map.connect "api/#{API_VERSION}/way/:id/history", :controller => 'old_way', :action => 'history', :id => nil
17   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'rest', :id => nil
18   map.connect "api/#{API_VERSION}/ways", :controller => 'way', :action => 'ways', :id => nil
19
20   map.connect "api/#{API_VERSION}/map", :controller => 'api', :action => 'map'
21   
22   # web site
23
24   map.connect '/', :controller => 'site', :action => 'index'
25   map.connect '/index.html', :controller => 'site', :action => 'index'
26   map.connect '/edit.html', :controller => 'site', :action => 'edit'
27   map.connect '/login.html', :controller => 'user', :action => 'login'
28   map.connect '/logout.html', :controller => 'user', :action => 'logout'
29   map.connect '/create-account.html', :controller => 'user', :action => 'new'
30   map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
31
32   # traces  
33   map.connect '/traces', :controller => 'trace', :action => 'list'
34   map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
35   map.connect '/traces/user/:user_login/:id', :controller => 'trace', :action => 'view', :id => nil
36   map.connect '/traces/user/:user_login/:id/picture', :controller => 'trace', :action => 'picture', :id => nil
37   map.connect '/traces/user/:user_login/:id/icon', :controller => 'trace', :action => 'icon', :id => nil
38
39   # fall through
40   map.connect ':controller/:action/:id'
41 end