Refactor: convert FilesController to a restful resource.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4085 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis committed 2010-09-14 16:24:07 +00:00
1 parent 41c055363e
commit 1b90703157
7 files changed
+12 -17

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
class FilesController < ApplicationController
menu_item :files
before_filter :find_project
before_filter :find_project_by_project_id
before_filter :authorize
helper :sort
@@ -31,6 +31,6 @@ class FilesController < ApplicationController
if !attachments.empty? && Setting.notified_events.include?('file_added')
Mailer.deliver_attachments_added(attachments[:files])
end
redirect_to :controller => 'files', :action => 'index', :id => @project
redirect_to project_files_path(@project)
end
end
+1 -1
View File
@@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to_if_authorized l(:label_attachment_new), {:controller => 'files', :action => 'new', :id => @project}, :class => 'icon icon-add' %>
<%= link_to_if_authorized l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add' %>
</div>
<h2><%=l(:label_attachment_plural)%></h2>
+1 -1
View File
@@ -2,7 +2,7 @@
<%= error_messages_for 'attachment' %>
<div class="box">
<% form_tag({ :action => 'create', :id => @project }, :multipart => true, :class => "tabular") do %>
<% form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %>
<% if @versions.any? %>
<p><label for="version_id"><%=l(:field_version)%></label>