Skip to content

Instantly share code, notes, and snippets.

@grosser
Created Oct 18, 2008
Embed
What would you like to do?
ActionController::Routing::Routes.draw do |map|
map.root :controller => 'homepage',:action=>'start'
map.signup '/signup', :controller => "users", :action => "new"
map.login '/login', :controller => "sessions", :action => "new"
map.logout '/logout', :controller => "sessions", :action => "destroy"
map.feedback '/feedback', :controller => "messages", :action => "feedback"
#user special
map.change_password '/change_password/:email_token', :controller => "users", :action => "change_password", :email_token => nil
map.activate '/activate/:email_token', :controller => "users", :action => "activate", :email_token => nil
map.claim '/claim/:email_token', :controller => "users", :action => "claim", :email_token => nil
map.filmmakers '/filmmakers', :controller => "people", :action => "filmmakers"
%w[start team privacy_policy terms_of_use imprint jury copyright getmore filmmakers_info logo explanation_burn_iso home static_content].each do |action|
map.send(action,"#{action}",:controller=>'homepage',:action=>action)
end
map.resources :abos
map.resources :addresses
map.resources :attachments
map.resources :dvds, :member=>{:download=>:get}
map.resources :favorites
map.resources :festivals, :collection => { :autocomplete_for_festival_name => :get}
map.resources :festival_participations
map.resources :homepage, :collection => {:team=>:get,:privacy_policy=>:get,:terms_of_use=>:get,:imprint=>:get,:home=>:get,:jury=>:get,:add_to_dvd=>:get,:buy_abo=>:get, :buy_movie=>:get, :copyright=>:get, :getmore=>:get, :filmmakers_info=>:get,:start=>:get,:logo=>:get, :explanation_burn_iso=>:get, :static_content=>:get }
map.resources :messages
map.resources :movies, :collection => { :autocomplete_for_movie_title_en => :get, :jury=>:get, :tutorial=>:get,:step_1=>:any}, :member => {:delete_file=>:delete,:ready=>:post,:upload_complete=>:get,:download=>:get,:report_problem=>:post, :license_agreement=>:get,:download_file=>:get}.merge(MoviesController.steps_routes)
map.resources :orders, :collection=>{:info_download=>:get,:info_dvd=>:get,:info_abo=>:get,:abo=>:any,:abo_return=>:any}, :member => {:checkout => :post, :complete=>:any, :ipn => :any}.merge(OrdersController.steps_routes)
map.resources :order_items
map.resources :organisations, :collection => { :autocomplete_for_organisation_name => :get}
map.resources :people, :collection => { :autocomplete_for_person_name => :get,:filmmakers=>:get}, :member => {:collaborators=>:get,:invite=>:post}
map.resources :production_companies
map.resources :ratings
map.resources :restrictions
map.resources :reviews
map.resources :sessions
map.resources :songs
map.resources :subtitles
map.resources :tags, :collection => { :autocomplete_for_tag_name => :get}
map.resources :team_members
map.resources :tracks
map.resources :users, :collection => { :autocomplete_for_user_name => :get, :request_password_change=>:post,:forgot_password=>:get,:change_password=>:get, :applet=>:any, :ftp=>:any}
map.namespace(:admin) do |admin|
admin.resources :abos
admin.resources :addresses
admin.resources :attachments
admin.resources :categories
admin.resources :campaigns, :member=>{:add_coupons=>:post}
admin.resources :coupons
admin.resources :dvds
admin.resources :festivals, :member => {:revert_to_version=>:post}
admin.resources :festival_participations
admin.resources :genres
admin.resources :messages
admin.resources :movies
admin.resources :orders
admin.resources :order_items
admin.resources :organisations, :member => {:revert_to_version=>:post}
admin.resources :people, :member => {:merge=>:post}, :collection=>{:duplicates=>:get}
admin.resources :playlists
admin.resources :playlist_items
admin.resources :production_companies
admin.resources :restrictions
admin.resources :reviews
admin.resources :resource_accesses
admin.resources :tags, :member => { :merge => :delete}
admin.resources :team_members
admin.resources :users
admin.resources :subtitles
end
#js single/list view alias to keep / free
map.js_view '/x', :controller => 'movies'
# 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
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
# map.connect ':controller/:action/:id'
# map.connect ':controller/:action/:id.:format'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment