comparison app/controllers/news_controller.rb @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +0100
parents cbb26bc654de
children 433d4f72a19b
comparison
equal deleted inserted replaced
909:cbb26bc654de 929:5f33065ddc4b
65 @news = News.new(:project => @project, :author => User.current) 65 @news = News.new(:project => @project, :author => User.current)
66 end 66 end
67 67
68 def create 68 def create
69 @news = News.new(:project => @project, :author => User.current) 69 @news = News.new(:project => @project, :author => User.current)
70 @news.safe_attributes = params[:news]
70 if request.post? 71 if request.post?
71 @news.attributes = params[:news]
72 if @news.save 72 if @news.save
73 flash[:notice] = l(:notice_successful_create) 73 flash[:notice] = l(:notice_successful_create)
74 redirect_to :controller => 'news', :action => 'index', :project_id => @project 74 redirect_to :controller => 'news', :action => 'index', :project_id => @project
75 else 75 else
76 render :action => 'new' 76 render :action => 'new'
80 80
81 def edit 81 def edit
82 end 82 end
83 83
84 def update 84 def update
85 if request.put? and @news.update_attributes(params[:news]) 85 @news.safe_attributes = params[:news]
86 if request.put? and @news.save
86 flash[:notice] = l(:notice_successful_update) 87 flash[:notice] = l(:notice_successful_update)
87 redirect_to :action => 'show', :id => @news 88 redirect_to :action => 'show', :id => @news
88 else 89 else
89 render :action => 'edit' 90 render :action => 'edit'
90 end 91 end