diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-14 20:44:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-14 20:44:48 +0000 |
commit | 4ebdcf13db34186bb562ed523c637dd6edc86682 (patch) | |
tree | 66be2cc4561468a6163202aa8b663954767727c3 /config/routes.rb | |
parent | f607a7a023774362979ca5113a48e1138566b3bb (diff) | |
download | redmine-4ebdcf13db34186bb562ed523c637dd6edc86682.tar.gz redmine-4ebdcf13db34186bb562ed523c637dd6edc86682.zip |
Add named routes for attachments and use route helpers in #link_to_attachment.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11187 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb index 9a93b4780..7a1eb663a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -257,10 +257,10 @@ RedmineApp::Application.routes.draw do get 'projects/:id/repository', :to => 'repositories#show', :path => nil # additional routes for having the file name at the end of url - match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get - match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get - match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get - match 'attachments/thumbnail/:id(/:size)', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get, :size => /\d+/ + get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment' + get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment' + get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/ + get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/ resources :attachments, :only => [:show, :destroy] resources :groups do |