diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-21 15:20:37 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-21 15:20:37 +0000 |
commit | 01d1a02df425cf5afb1036e57f2d148059472786 (patch) | |
tree | b6f75447b0227a5871a8fd7d633fbefa9953b318 /app/controllers/news_controller.rb | |
parent | 51359704a0a4a4af49fa8724059bc292649bb1da (diff) | |
download | redmine-01d1a02df425cf5afb1036e57f2d148059472786.tar.gz redmine-01d1a02df425cf5afb1036e57f2d148059472786.zip |
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
Diffstat (limited to 'app/controllers/news_controller.rb')
-rw-r--r-- | app/controllers/news_controller.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index f4e4b6559..5a1d36e0f 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -60,14 +60,19 @@ class NewsController < ApplicationController end end end - + def edit - if request.post? and @news.update_attributes(params[:news]) + 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 |