/
routes.rb
67 lines (49 loc) · 2.87 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assign values other than :controller and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route (maps HTTP verbs to controller actions automatically):
# map.resources :products
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
# admin.resources :products
# end
# For restful_authentication:
map.resources :users
map.resource :user_session
# And some prettification...
map.login 'login', :controller => 'user_sessions', :action => 'new'
map.logout 'logout', :controller => 'user_sessions', :action => 'destroy'
map.register 'register', :controller => 'users', :action => 'new'
map.reset_password 'reset', :controller => 'users', :action => 'reset'
map.regenerate_key 'regenerate_key', :controller => 'users', :action => 'regenerate_key'
map.profile 'profile', :controller => 'users', :action => 'edit'
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
# map.root :controller => "welcome"
map.root :controller => 'events'
map.connect 'events/index', :controller => 'events', :action => 'index'
map.feed_events 'events/feed.:fmt/:key', :controller => 'events', :action => 'feed' # can't use :format with this URL syntax
map.resources :events
map.resources :permissions, :member => {:destroy => :get}
map.resources :calendars
map.subscriptions 'subscriptions', :controller => 'permissions', :action => 'index'
map.subscribe 'subscribe/:calendar_id', :controller => 'permissions', :action => 'subscribe'
# Some stuff for sorting the event list
map.connect 'events/index/:order/:direction', :controller => 'events', :action => 'index', :direction => /(a|de)sc/, :defaults => {:order => 'date', :direction => 'asc'}
map.connect ':controller', :action => 'index'
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
map.connect ':controller/:id/:action'
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action'
end