diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -88,7 +88,7 @@ flash[:notice] = 'Error: Uploaded file is not PDF' render :action => 'edit' and return end - if @problem.update_attributes(params[:problem]) + if @problem.update_attributes(problem_params) flash[:notice] = 'Problem was successfully updated.' unless params[:file] == nil or params[:file] == '' flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' @@ -285,4 +285,10 @@ def get_problems_stat end + private + + def problem_params + params.require(:problem).permit(:name, :full_name, :full_score, :date_added, :available, :test_allowed,:output_only, :url, :description) + end + end