# HG changeset patch # User Jittat Fakcharoenphol # Date 2019-10-05 07:42:41 # Node ID 3d1a060b037813b562fbe3b0c37c78cd3d39f0f2 # Parent 0f0c4f139f2bf1be1a3b814daec88ea468405a86 fixed problem insertion attribute error 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 @@ -29,7 +29,7 @@ def create @problem = Problem.new(problem_params) - @description = Description.new(params[:description]) + @description = Description.new(description_params) if @description.body!='' if !@description.save render :action => new and return @@ -252,6 +252,10 @@ ################################## protected + def description_params + params.require(:description).permit(:body, :markdowned) + end + def allow_test_pair_import? if defined? ALLOW_TEST_PAIR_IMPORT return ALLOW_TEST_PAIR_IMPORT