Allows attachments on news (#1972).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8728 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-29 22:39:06 +00:00
parent 992aebf6df
commit 24138187eb
9 changed files with 80 additions and 18 deletions
+5
View File
@@ -27,6 +27,7 @@ class NewsController < ApplicationController
accept_api_auth :index
helper :watchers
helper :attachments
def index
case params[:format]
@@ -70,6 +71,8 @@ class NewsController < ApplicationController
if request.post?
@news.attributes = params[:news]
if @news.save
attachments = Attachment.attach_files(@news, params[:attachments])
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_create)
redirect_to :controller => 'news', :action => 'index', :project_id => @project
else
@@ -83,6 +86,8 @@ class NewsController < ApplicationController
def update
if request.put? and @news.update_attributes(params[:news])
attachments = Attachment.attach_files(@news, params[:attachments])
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @news
else