toolmantim / webjam

Old repository for webjam. New one lives at http://github.com/webjam/webjam

This URL has Read+Write access

toolmantim (author)
Tue Sep 09 06:41:24 -0700 2008
commit  cd4c4a9d1539a6e6e18484caf4cea10bb05dcc40
tree    b3cb761497936f81dc28a3c913fc3c5028915f4b
parent  4f4e3e51d4c29817f268eecb1cc54d454bf8e09a
webjam / config / routes.rb
100644 70 lines (60 sloc) 3.341 kb
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
68
69
70
ActionController::Routing::Routes.draw do |map|
  EVENT_TAG = /webjam\d+/
 
  # super friendly post urls
  map.posts 'news', :controller => 'posts', :action => 'index'
  map.posts_year 'news/:year',
                :controller => 'posts',
                :action => 'index_by_year',
                :year => /\d{4}/
  map.post 'news/:year/:permalink',
                :controller => 'posts',
                :action => 'show',
                :year => /\d{4}/
  map.post_comments 'news/:year/:permalink/comments',
                :controller => 'comments',
                :action => 'create',
                :year => /\d{4}/,
                :conditions => { :method => :post }
 
  map.resources :comments
  map.resource :session, :member => { :create => :any }
 
  map.event ":id", :controller => "events", :action => "show", :requirements => {:id => EVENT_TAG}
 
  map.with_options(:controller => "rsvps", :requirements => {:event_id => EVENT_TAG}, :path_prefix => ":event_id", :name_prefix => "event_") do |rsvps|
    rsvps.rsvp "rsvp", :action => "show", :conditions => { :method => :get }
    rsvps.rsvp "rsvp", :action => "destroy", :conditions => { :method => :delete }
    rsvps.rsvp "rsvp", :action => "update" # put and post
    rsvps.rsvp_pike "rsvp/pike", :action => "pike", :conditions => {:method => :get}
  end
  
  map.with_options(:controller => "presentation_proposals", :requirements => {:event_id => EVENT_TAG}) do |proposals|
    proposals.event_presentation_proposal ":event_id/proposal", :action => "edit", :conditions => { :method => :get }
    proposals.event_presentation_proposal ":event_id/proposal", :action => "update", :conditions => { :method => :post }
    proposals.event_presentation_proposal ":event_id/proposal", :action => "destroy", :conditions => { :method => :delete }
  end
  
  map.with_options(:controller => "users") do |user|
    user.update_profile_details_current_user 'account/update_profile_details', :conditions => {:method => :put}, :action => "update_profile_details"
    user.update_privacy_current_user 'account/update_privacy', :conditions => {:method => :put}, :action => "update_profile_details"
    user.edit_current_user 'account', :conditions => {:method => :get}, :action => "edit"
  end
  map.resources :users, :collection => {:verify => :any, :details => :get, :create => :post}
  
  map.resource :mugshot, :name_prefix => 'current_'
  map.resources :mugshots, :member => {:crop => :any}
 
  map.resources :identity_urls, :collection => {:create => :any}
  map.with_options(:controller => 'pages') do |m|
    m.contact 'contact', :action => 'contact'
    m.home '', :action => 'home'
    m.open_id 'single-sign-on', :action => 'single-sign-on'
    m.contributors 'contributors', :action => "contributors"
    m.vote_vis 'votestream', :action => "votestream"
    # temporary static files to build front-end
    m.statichome 'staticpres', :action => 'staticpres'
  end
  map.namespace :admin do |admin|
    admin.resources :events do |event|
      event.resources :rsvps, :proposals, :jams
    end
    admin.resources :posts
  end
  map.admin 'admin', :controller => 'admin/home'
  map.legacy_post 'post/:permalink.html', :controller => "posts", :action => "legacy"
  map.user '*path_info', :controller => 'users', :action => 'show'
  
  map.root :home
end