Commit d7eb7970249b662ebcc2673001503a247d7fbe48
1 parent
94f91146
Exists in
master
and in
4 other branches
1.9 Hash syntax in routes.rb
Also cleans up some alignment and removes unnecessary "to: " arguments
Showing
1 changed file
with
52 additions
and
51 deletions
Show diff stats
config/routes.rb
@@ -23,14 +23,14 @@ Gitlab::Application.routes.draw do | @@ -23,14 +23,14 @@ Gitlab::Application.routes.draw do | ||
23 | # | 23 | # |
24 | # Help | 24 | # Help |
25 | # | 25 | # |
26 | - get 'help' => 'help#index' | ||
27 | - get 'help/permissions' => 'help#permissions' | ||
28 | - get 'help/workflow' => 'help#workflow' | ||
29 | - get 'help/api' => 'help#api' | ||
30 | - get 'help/web_hooks' => 'help#web_hooks' | 26 | + get 'help' => 'help#index' |
27 | + get 'help/permissions' => 'help#permissions' | ||
28 | + get 'help/workflow' => 'help#workflow' | ||
29 | + get 'help/api' => 'help#api' | ||
30 | + get 'help/web_hooks' => 'help#web_hooks' | ||
31 | get 'help/system_hooks' => 'help#system_hooks' | 31 | get 'help/system_hooks' => 'help#system_hooks' |
32 | - get 'help/markdown' => 'help#markdown' | ||
33 | - get 'help/ssh' => 'help#ssh' | 32 | + get 'help/markdown' => 'help#markdown' |
33 | + get 'help/ssh' => 'help#ssh' | ||
34 | 34 | ||
35 | # | 35 | # |
36 | # Admin Area | 36 | # Admin Area |
@@ -43,19 +43,19 @@ Gitlab::Application.routes.draw do | @@ -43,19 +43,19 @@ Gitlab::Application.routes.draw do | ||
43 | put :unblock | 43 | put :unblock |
44 | end | 44 | end |
45 | end | 45 | end |
46 | - resources :projects, :constraints => { :id => /[^\/]+/ } do | 46 | + resources :projects, constraints: { id: /[^\/]+/ } do |
47 | member do | 47 | member do |
48 | get :team | 48 | get :team |
49 | put :team_update | 49 | put :team_update |
50 | end | 50 | end |
51 | end | 51 | end |
52 | - resources :team_members, :only => [:edit, :update, :destroy] | ||
53 | - resources :hooks, :only => [:index, :create, :destroy] do | 52 | + resources :team_members, only: [:edit, :update, :destroy] |
53 | + resources :hooks, only: [:index, :create, :destroy] do | ||
54 | get :test | 54 | get :test |
55 | end | 55 | end |
56 | resource :logs, only: [:show] | 56 | resource :logs, only: [:show] |
57 | - resource :resque, :controller => 'resque', only: [:show] | ||
58 | - root :to => "dashboard#index" | 57 | + resource :resque, controller: 'resque', only: [:show] |
58 | + root to: "dashboard#index" | ||
59 | end | 59 | end |
60 | 60 | ||
61 | get "errors/githost" | 61 | get "errors/githost" |
@@ -63,31 +63,32 @@ Gitlab::Application.routes.draw do | @@ -63,31 +63,32 @@ Gitlab::Application.routes.draw do | ||
63 | # | 63 | # |
64 | # Profile Area | 64 | # Profile Area |
65 | # | 65 | # |
66 | - get "profile/account", :to => "profile#account" | ||
67 | - get "profile/history", :to => "profile#history" | ||
68 | - put "profile/password", :to => "profile#password_update" | ||
69 | - get "profile/token", :to => "profile#token" | ||
70 | - put "profile/reset_private_token", :to => "profile#reset_private_token" | ||
71 | - get "profile", :to => "profile#show" | ||
72 | - get "profile/design", :to => "profile#design" | ||
73 | - put "profile/update", :to => "profile#update" | 66 | + get "profile/account" => "profile#account" |
67 | + get "profile/history" => "profile#history" | ||
68 | + put "profile/password" => "profile#password_update" | ||
69 | + get "profile/token" => "profile#token" | ||
70 | + put "profile/reset_private_token" => "profile#reset_private_token" | ||
71 | + get "profile" => "profile#show" | ||
72 | + get "profile/design" => "profile#design" | ||
73 | + put "profile/update" => "profile#update" | ||
74 | + | ||
74 | resources :keys | 75 | resources :keys |
75 | 76 | ||
76 | # | 77 | # |
77 | # Dashboard Area | 78 | # Dashboard Area |
78 | # | 79 | # |
79 | - get "dashboard", :to => "dashboard#index" | ||
80 | - get "dashboard/issues", :to => "dashboard#issues" | ||
81 | - get "dashboard/merge_requests", :to => "dashboard#merge_requests" | 80 | + get "dashboard" => "dashboard#index" |
81 | + get "dashboard/issues" => "dashboard#issues" | ||
82 | + get "dashboard/merge_requests" => "dashboard#merge_requests" | ||
82 | 83 | ||
83 | - resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create] | 84 | + resources :projects, constraints: { id: /[^\/]+/ }, only: [:new, :create] |
84 | 85 | ||
85 | - devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks } | 86 | + devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks } |
86 | 87 | ||
87 | # | 88 | # |
88 | # Project Area | 89 | # Project Area |
89 | # | 90 | # |
90 | - resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do | 91 | + resources :projects, constraints: { id: /[^\/]+/ }, except: [:new, :create, :index], path: "/" do |
91 | member do | 92 | member do |
92 | get "team" | 93 | get "team" |
93 | get "wall" | 94 | get "wall" |
@@ -95,7 +96,7 @@ Gitlab::Application.routes.draw do | @@ -95,7 +96,7 @@ Gitlab::Application.routes.draw do | ||
95 | get "files" | 96 | get "files" |
96 | end | 97 | end |
97 | 98 | ||
98 | - resources :wikis, :only => [:show, :edit, :destroy, :create] do | 99 | + resources :wikis, only: [:show, :edit, :destroy, :create] do |
99 | collection do | 100 | collection do |
100 | get :pages | 101 | get :pages |
101 | end | 102 | end |
@@ -114,46 +115,45 @@ Gitlab::Application.routes.draw do | @@ -114,46 +115,45 @@ Gitlab::Application.routes.draw do | ||
114 | end | 115 | end |
115 | 116 | ||
116 | resources :deploy_keys | 117 | resources :deploy_keys |
117 | - resources :protected_branches, :only => [:index, :create, :destroy] | 118 | + resources :protected_branches, only: [:index, :create, :destroy] |
118 | 119 | ||
119 | - resources :refs, :only => [], :path => "/" do | 120 | + resources :refs, only: [], path: "/" do |
120 | collection do | 121 | collection do |
121 | get "switch" | 122 | get "switch" |
122 | end | 123 | end |
123 | 124 | ||
124 | member do | 125 | member do |
125 | - get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ } | ||
126 | - get "logs_tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ } | 126 | + get "tree", constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } |
127 | + get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } | ||
127 | 128 | ||
128 | get "blob", | 129 | get "blob", |
129 | - :constraints => { | ||
130 | - :id => /[a-zA-Z.0-9\/_\-]+/, | ||
131 | - :path => /.*/ | 130 | + constraints: { |
131 | + id: /[a-zA-Z.0-9\/_\-]+/, | ||
132 | + path: /.*/ | ||
132 | } | 133 | } |
133 | 134 | ||
134 | - | ||
135 | # tree viewer | 135 | # tree viewer |
136 | get "tree/:path" => "refs#tree", | 136 | get "tree/:path" => "refs#tree", |
137 | - :as => :tree_file, | ||
138 | - :constraints => { | ||
139 | - :id => /[a-zA-Z.0-9\/_\-]+/, | ||
140 | - :path => /.*/ | 137 | + as: :tree_file, |
138 | + constraints: { | ||
139 | + id: /[a-zA-Z.0-9\/_\-]+/, | ||
140 | + path: /.*/ | ||
141 | } | 141 | } |
142 | 142 | ||
143 | # tree viewer | 143 | # tree viewer |
144 | get "logs_tree/:path" => "refs#logs_tree", | 144 | get "logs_tree/:path" => "refs#logs_tree", |
145 | - :as => :logs_file, | ||
146 | - :constraints => { | ||
147 | - :id => /[a-zA-Z.0-9\/_\-]+/, | ||
148 | - :path => /.*/ | 145 | + as: :logs_file, |
146 | + constraints: { | ||
147 | + id: /[a-zA-Z.0-9\/_\-]+/, | ||
148 | + path: /.*/ | ||
149 | } | 149 | } |
150 | 150 | ||
151 | # blame | 151 | # blame |
152 | get "blame/:path" => "refs#blame", | 152 | get "blame/:path" => "refs#blame", |
153 | - :as => :blame_file, | ||
154 | - :constraints => { | ||
155 | - :id => /[a-zA-Z.0-9\/_\-]+/, | ||
156 | - :path => /.*/ | 153 | + as: :blame_file, |
154 | + constraints: { | ||
155 | + id: /[a-zA-Z.0-9\/_\-]+/, | ||
156 | + path: /.*/ | ||
157 | } | 157 | } |
158 | end | 158 | end |
159 | end | 159 | end |
@@ -178,7 +178,7 @@ Gitlab::Application.routes.draw do | @@ -178,7 +178,7 @@ Gitlab::Application.routes.draw do | ||
178 | end | 178 | end |
179 | end | 179 | end |
180 | 180 | ||
181 | - resources :hooks, :only => [:index, :create, :destroy] do | 181 | + resources :hooks, only: [:index, :create, :destroy] do |
182 | member do | 182 | member do |
183 | get :test | 183 | get :test |
184 | end | 184 | end |
@@ -194,7 +194,7 @@ Gitlab::Application.routes.draw do | @@ -194,7 +194,7 @@ Gitlab::Application.routes.draw do | ||
194 | end | 194 | end |
195 | resources :team_members | 195 | resources :team_members |
196 | resources :milestones | 196 | resources :milestones |
197 | - resources :labels, :only => [:index] | 197 | + resources :labels, only: [:index] |
198 | resources :issues do | 198 | resources :issues do |
199 | 199 | ||
200 | collection do | 200 | collection do |
@@ -203,11 +203,12 @@ Gitlab::Application.routes.draw do | @@ -203,11 +203,12 @@ Gitlab::Application.routes.draw do | ||
203 | get :search | 203 | get :search |
204 | end | 204 | end |
205 | end | 205 | end |
206 | - resources :notes, :only => [:index, :create, :destroy] do | 206 | + resources :notes, only: [:index, :create, :destroy] do |
207 | collection do | 207 | collection do |
208 | post :preview | 208 | post :preview |
209 | end | 209 | end |
210 | end | 210 | end |
211 | end | 211 | end |
212 | - root :to => "dashboard#index" | 212 | + |
213 | + root to: "dashboard#index" | ||
213 | end | 214 | end |