-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added routes such that URLs as /show/HomePage are directed to DEFAULT…
…_WEB/show/HomePage, if DEFAULT_WEB is defined. This would greatly simplify Proxy configuration for sites like instiki.org
- Loading branch information
Alexey Verkhovsky
committed
Jul 20, 2005
1 parent
9d667c8
commit 55c1254
Showing
1 changed file
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
# Create a route to DEFAULT_WEB, if such is specified; also register a generic route | ||
def connect_to_web(map, generic_path, generic_routing_options) | ||
if defined? DEFAULT_WEB | ||
explicit_path = generic_path.gsub(':web', DEFAULT_WEB) | ||
explicit_routing_options = generic_routing_options.merge(:web => DEFAULT_WEB) | ||
map.connect(explicit_path, explicit_routing_options) | ||
end | ||
map.connect(generic_path, generic_routing_options) | ||
end | ||
|
||
ActionController::Routing::Routes.draw do |map| | ||
map.connect 'create_system', :controller => 'admin', :action => 'create_system' | ||
map.connect 'create_web', :controller => 'admin', :action => 'create_web' | ||
map.connect ':web/edit_web', :controller => 'admin', :action => 'edit_web' | ||
map.connect 'remove_orphaned_pages', :controller => 'admin', :action => 'remove_orphaned_pages' | ||
map.connect 'web_list', :controller => 'wiki', :action => 'web_list' | ||
|
||
map.connect ':web/file/:id', :controller => 'file', :action => 'file' | ||
map.connect ':web/pic/:id', :controller => 'file', :action => 'pic' | ||
map.connect ':web/import/:id', :controller => 'file', :action => 'import' | ||
connect_to_web map, ':web/edit_web', :controller => 'admin', :action => 'edit_web' | ||
connect_to_web map, ':web/file/:id', :controller => 'file', :action => 'file' | ||
connect_to_web map, ':web/pic/:id', :controller => 'file', :action => 'pic' | ||
connect_to_web map, ':web/import/:id', :controller => 'file', :action => 'import' | ||
connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login' | ||
connect_to_web map, ':web/web_list', :controller => 'wiki', :action => 'web_list' | ||
connect_to_web map, ':web/:action/:id', :controller => 'wiki' | ||
connect_to_web map, ':web/:action', :controller => 'wiki' | ||
connect_to_web map, ':web', :controller => 'wiki', :action => 'index' | ||
|
||
map.connect ':web/login', :controller => 'wiki', :action => 'login' | ||
map.connect 'web_list', :controller => 'wiki', :action => 'web_list' | ||
map.connect ':web/web_list', :controller => 'wiki', :action => 'web_list' | ||
map.connect ':web/:action/:id', :controller => 'wiki' | ||
map.connect ':web/:action', :controller => 'wiki' | ||
map.connect ':web', :controller => 'wiki', :action => 'index' | ||
map.connect '', :controller => 'wiki', :action => 'index' | ||
if defined? DEFAULT_WEB | ||
map.connect '', :controller => 'wiki', :web => DEFAULT_WEB, :action => 'index' | ||
else | ||
map.connect '', :controller => 'wiki', :action => 'index' | ||
end | ||
end |