put "relation/:id" => "relations#update", :id => /\d+/
delete "relation/:id" => "relations#delete", :id => /\d+/
get "relations" => "relations#index"
-
- get "map" => "map#index"
end
namespace :api, :path => "api/0.6" do
+ resource :map, :only => :show
+
resources :tracepoints, :path => "trackpoints", :only => :index
resources :users, :only => :index
post "/preview/:type" => "site#preview", :as => :preview
# traces
- resources :traces, :id => /\d+/, :except => [:show]
+ resources :traces, :id => /\d+/, :except => [:show] do
+ resource :data, :module => :traces, :only => :show
+ end
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", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/traces")
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 "/trace/:id/data", :format => false, :id => /\d+/, :to => redirect(:path => "/traces/%{id}/data")
+ get "/trace/:id/data.:format", :id => /\d+/, :to => redirect(:path => "/traces/%{id}/data.%{format}")
get "/trace/:id/edit", :id => /\d+/, :to => redirect(:path => "/traces/%{id}/edit")
namespace :traces, :path => "" do
# messages
resources :messages, :path_names => { :new => "new/:display_name" }, :id => /\d+/, :only => [:new, :create, :show, :destroy] do
- post :mark
- patch :unmute
-
- resource :reply, :module => :messages, :path_names => { :new => "new" }, :only => :new
+ scope :module => :messages do
+ resource :reply, :path_names => { :new => "new" }, :only => :new
+ resource :read_mark, :only => [:create, :destroy]
+ resource :mute, :only => :destroy
+ end
end
namespace :messages, :path => "/messages" do
resource :inbox, :only => :show