forked from huacnlee/personlab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
routes.rb
32 lines (23 loc) · 1.15 KB
/
routes.rb
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
ActionController::Routing::Routes.draw do |map|
map.root :controller => "home"
# Control Panel
map.namespace(:cpanel) do |cpanel|
cpanel.root :controller => "home"
cpanel.login "login",:controller => "home", :action => "login"
cpanel.login "logout",:controller => "home", :action => "logout"
cpanel.resources :menus,:pages,:posts,:comments,:settings
end
# Share
# Blog
map.purchase "blog", :controller => "posts"
map.purchase "blog", :controller => "posts", :action => "index"
map.purchase "blog/rss", :controller => "posts", :action => "rss"
map.purchase "blog/page/:page", :controller => "posts", :action => "index", :requirements => { :page => /[\d]+/ }
map.purchase "blog/:slug", :controller => "posts", :action => "show", :requirements => { :slug => /[a-z0-9A-Z\-\_\.]+/ }
map.purchase "share", :controller => "home", :action => "share"
# Pages (This well be stay last line)
map.purchase ":slug", :controller => "home", :action => "show", :requirements => { :slug => /[a-z0-9A-Z\-\_\.]+/ }
# base routes
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end