Do not check the request http method.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8941 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-02-23 13:05:10 +00:00
parent 435a634ac7
commit 4f217618af

View File

@ -68,7 +68,6 @@ class NewsController < ApplicationController
def create
@news = News.new(:project => @project, :author => User.current)
if request.post?
@news.attributes = params[:news]
if @news.save
attachments = Attachment.attach_files(@news, params[:attachments])
@ -79,13 +78,12 @@ class NewsController < ApplicationController
render :action => 'new'
end
end
end
def edit
end
def update
if request.put? and @news.update_attributes(params[:news])
if @news.update_attributes(params[:news])
attachments = Attachment.attach_files(@news, params[:attachments])
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_update)