comparison app/controllers/news_controller.rb @ 931:ec1c49528f36 cannam_integration

Merge from branch "redmine-1.3"
author Chris Cannam
date Wed, 27 Jun 2012 15:04:58 +0100
parents 5f33065ddc4b
children 433d4f72a19b
comparison
equal deleted inserted replaced
930:027cc0f5d4a2 931:ec1c49528f36
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