Skip to content

Instantly share code, notes, and snippets.

@bogdan
Created September 16, 2010 15:23
Show Gist options
  • Save bogdan/582601 to your computer and use it in GitHub Desktop.
Save bogdan/582601 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.login 'login', :controller => 'user_sessions', :action => 'new'
map.logout 'logout', :controller => 'user_sessions', :action => 'destroy'
map.resource :user_session
map.resources :users
map.resources :tasks
map.resource :preview, :controller => "preview"
map.namespace :admin do |a|
a.resources :users
a.resource :user_session
a.resources :failed_imports
a.resources :authors
a.resources :panel
end
map.resources :search
map.resources :authors do |a|
a.namespace :authors do |author|
author.resources :fans, :controller => "fans", :collection => { :remove => :post }
author.resources :join_requests, :controller => "join_requests"
author.resources :feedbacks, :controller => "feedbacks", :as => "recommendations"
author.resources :feedbacks_on_authors_books, :controller => "feedbacks_on_authors_books", :as => "recommendations_for"
author.resources :announcements
end
end
map.resources :author_dashboard do |a|
a.namespace :author_dashboard do |author_dashboard|
author_dashboard.resources :fan_messages, :collection => {:update => :put}
author_dashboard.resource :account, :controller => "account"
author_dashboard.resource :profile, :controller => "profile", :collection => {:update => :put}
author_dashboard.resources :fans, :collection => {:csv => :get}
author_dashboard.resources :announcements
end
end
map.namespace :personal_dashboard do |a|
a.resource :account, :controller => "account"
end
map.resources :books do |b|
b.namespace :books do |book|
book.resources :feedbacks, :controller => "feedbacks"
book.resources :similar_books
end
end
map.resources :agregated_search, :as => "topbooks"
map.root :controller => 'landing'
map.terms "/terms", :controller => 'static', :action => "terms"
map.privacy "/privacy", :controller => 'static', :action => "privacy"
map.about "/about", :controller => 'static', :action => "about"
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment