Skip to content

Instantly share code, notes, and snippets.

@andreierdoss
Created March 25, 2009 21:59
Show Gist options
  • Save andreierdoss/85747 to your computer and use it in GitHub Desktop.
Save andreierdoss/85747 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.resources :profiles
map.resources :streams, :only => [:index, :show]
map.with_options(:controller => 'groups') do |group|
group.tag_groups '/groups/tag/:tag', :action => 'tag'
end
map.resources :groups, :collection => { :search => :get }, :member => { :join => :get, :leave => :get }
map.namespace(:member) do |member|
member.resources :profiles
member.resources :groups
member.with_options(:controller => 'groups') do |group|
group.group_pending_members '/:id/members/pending', :action => 'pending_members'
group.group_accept_member '/:id/members/:user_id/accept', :action => 'accept_member'
group.group_reject_member '/:id/members/:user_id/reject', :action => 'reject_member'
end
member.with_options(:controller => 'friendships') do |friendship|
friendship.add_friend '/friend/:friend_id/add', :action => 'add_friend'
friendship.confirm_friend '/friend/:friend_id/confirm', :action => 'confirm_friend'
friendship.follow_user '/follow/:friend_id', :action => 'follow'
friendship.unfollow_user '/unfollow/:friend_id', :action => 'unfollow'
end
member.with_options(:controller => 'sharings') do |sharing|
sharing.share '/share/:shareable_type/:shareable_id', :action => 'index'
sharing.share_with_group '/group/:id/share/:shareable_type/:shareable_id', :action => 'share'
end
end
map.namespace(:admin) do |admin|
admin.resources :groups, :member => { :activate => :post}
end
# => oauth support
map.resources :oauth_clients
map.authorize '/oauth/authorize', :controller=>'oauth', :action=>'authorize'
map.request_token '/oauth/request_token', :controller=>'oauth', :action=>'request_token'
map.access_token '/oauth/access_token', :controller=>'oauth', :action=>'access_token'
map.test_request '/oauth/test_request', :controller=>'oauth', :action=>'test_request'
map.x1 '/oauth_test', :controller=>'oauth_test', :action=>'test'
map.x2 '/oauth_callback', :controller=>'oauth_test', :action=>'callback'
# => oauth support
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment