##// END OF EJS Templates
route: use constraints for repositories ":format => 'raw'" and :action...
Toshi MARUYAMA -
r9365:8047a8cd28d7
parent child
Show More
@@ -254,12 +254,28 RedmineApp::Application.routes.draw do
254 :action => /(browse|show|entry|changes|annotate|diff)/,
254 :action => /(browse|show|entry|changes|annotate|diff)/,
255 :rev => /[a-z0-9\.\-_]+/
255 :rev => /[a-z0-9\.\-_]+/
256 }
256 }
257 get 'projects/:id/repository/:repository_id/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/
257 get 'projects/:id/repository/:repository_id/:format(/*path(.:ext))',
258 get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', :controller => 'repositories', :action => /(browse|show|entry|changes|annotate|diff)/
258 :to => 'repositories#entry',
259 :constraints => {
260 :format => 'raw'
261 }
262 get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
263 :controller => 'repositories',
264 :constraints => {
265 :action => /(browse|entry|changes|annotate|diff)/
266 }
259 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
267 get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
260
268
261 get 'projects/:id/repository/:format(/*path(.:ext))', :to => 'repositories#entry', :format => /raw/
269 get 'projects/:id/repository/:format(/*path(.:ext))',
262 get 'projects/:id/repository/:action(/*path(.:ext))', :controller => 'repositories', :action => /(browse|show|entry|changes|annotate|diff)/
270 :to => 'repositories#entry',
271 :constraints => {
272 :format => 'raw'
273 }
274 get 'projects/:id/repository/:action(/*path(.:ext))',
275 :controller => 'repositories',
276 :constraints => {
277 :action => /(browse|entry|changes|annotate|diff)/
278 }
263 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
279 get 'projects/:id/repository', :to => 'repositories#show', :path => nil
264
280
265 # additional routes for having the file name at the end of url
281 # additional routes for having the file name at the end of url
General Comments 0
You need to be logged in to leave comments. Login now