routes.rb
3.49 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
require 'noosfero'
ActionController::Routing::Routes.draw do |map|
# 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)
######################################################
## Public controllers
######################################################
# You can have the root of your site routed by hooking up ''
# -- just remember to delete public/index.html.
map.connect '', :controller => "home"
# user account controller
map.connect 'account/new_password/:code', :controller => 'account', :action => 'new_password'
map.connect 'account/:action', :controller => 'account'
# enterprise registration
map.connect 'enterprise_registration/:action', :controller => 'enterprise_registration'
# tags
map.tag 'tag', :controller => 'search', :action => 'tags'
map.tag 'tag/:tag', :controller => 'search', :action => 'tag'
# search
map.connect 'search/filter/*category_path', :controller => 'search', :action => 'filter'
map.connect 'search/:action', :controller => 'search'
# categories controller
map.connect 'cat', :controller => 'category', :action => 'index'
map.category 'cat/*category_path', :controller => 'category', :action => 'view'
# controllers for blocks
map.controllers 'block/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_from_design_blocks
# public profile information
map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index'
######################################################
## Controllers that are profile-specific (for profile admins )
######################################################
# profile customization - "My profile"
map.myprofile 'myprofile/:profile', :controller => 'profile_editor', :action => 'index'
map.myprofile 'myprofile/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('my_profile')
######################################################
## Controllers that are used by environment admin
######################################################
# administrative tasks for a environment
map.admin 'admin', :controller => 'admin_panel'
map.admin 'admin/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('admin')
######################################################
## Controllers that are used by system admin
######################################################
# administrative tasks for a environment
map.system 'system', :controller => 'system'
map.system 'system/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_in_directory('system')
######################################################
## Test controllers.
## FIXME: this should not be needed
######################################################
map.connect 'test/:controller/:action/:id' , :controller => /.*test.*/
map.connect ':profile/catalog/:action/:id', :controller => 'catalog'
# *content viewing*
# XXX this route must come last so other routes have priority over it.
map.homepage ':profile/*page', :controller => 'content_viewer', :action => 'view_page'
end