##// END OF EJS Templates
Do not check the request http method....
Jean-Philippe Lang -
r8821:4f217618af50
parent child
Show More
@@ -68,7 +68,6 class NewsController < ApplicationController
68
68
69 def create
69 def create
70 @news = News.new(:project => @project, :author => User.current)
70 @news = News.new(:project => @project, :author => User.current)
71 if request.post?
72 @news.attributes = params[:news]
71 @news.attributes = params[:news]
73 if @news.save
72 if @news.save
74 attachments = Attachment.attach_files(@news, params[:attachments])
73 attachments = Attachment.attach_files(@news, params[:attachments])
@@ -79,13 +78,12 class NewsController < ApplicationController
79 render :action => 'new'
78 render :action => 'new'
80 end
79 end
81 end
80 end
82 end
83
81
84 def edit
82 def edit
85 end
83 end
86
84
87 def update
85 def update
88 if request.put? and @news.update_attributes(params[:news])
86 if @news.update_attributes(params[:news])
89 attachments = Attachment.attach_files(@news, params[:attachments])
87 attachments = Attachment.attach_files(@news, params[:attachments])
90 render_attachment_warning_if_needed(@news)
88 render_attachment_warning_if_needed(@news)
91 flash[:notice] = l(:notice_successful_update)
89 flash[:notice] = l(:notice_successful_update)
General Comments 0
You need to be logged in to leave comments. Login now