mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 03:15:57 +01:00
Refactor: split NewsController#edit into #edit and #update
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4168 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -60,14 +60,19 @@ class NewsController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def edit
|
||||
if request.post? and @news.update_attributes(params[:news])
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to :action => 'show', :id => @news
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
if request.put? and @news.update_attributes(params[:news])
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to :action => 'show', :id => @news
|
||||
else
|
||||
render :action => 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
def add_comment
|
||||
@comment = Comment.new(params[:comment])
|
||||
@comment.author = User.current
|
||||
|
||||
Reference in New Issue
Block a user