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 @@ -15,6 +15,7 @@ verify :method => :post, :only => [ :destroy, :create, :quick_create, :do_manage, + :do_import, :update ], :redirect_to => { :action => :list } @@ -145,6 +146,20 @@ redirect_to :action => 'manage' end + def import + end + + def do_import + @problem, import_log = Problem.new_from_import_form_params(params) + + if @problem.errors.length != 0 + render :action => 'import' and return + end + + @problem.save + @log = import_log + end + ################################## protected