]> source.dussan.org Git - redmine.git/commitdiff
Added method to attachments routes.
authorEtienne Massip <etienne.massip@gmail.com>
Sat, 10 Dec 2011 13:50:07 +0000 (13:50 +0000)
committerEtienne Massip <etienne.massip@gmail.com>
Sat, 10 Dec 2011 13:50:07 +0000 (13:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8167 e93f8b46-1217-0410-a6f0-8f06a7374b81

config/routes.rb

index 7d9254f036eaa5acec15ac24ad42dd60e3f456a4..b43c79b7e338386501a912c39d3946a5a7d05d61 100644 (file)
@@ -199,9 +199,9 @@ ActionController::Routing::Routes.draw do |map|
 
   map.resources :attachments, :only => [:show, :destroy]
   # additional routes for having the file name at the end of url
-  map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
-  map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
-  map.connect 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/
+  map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get}
+  map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get}
+  map.connect 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :conditions => {:method => :get}
 
   map.resources :groups, :member => {:autocomplete_for_user => :get}
   map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post}