]> git.openstreetmap.org Git - rails.git/commitdiff
Return after rendering - stops further processing in controller
authorJ Guthrie <jamie.guthrie@gmail.com>
Wed, 25 Jul 2018 01:30:59 +0000 (02:30 +0100)
committerJ Guthrie <jamie.guthrie@gmail.com>
Wed, 25 Jul 2018 01:30:59 +0000 (02:30 +0100)
app/controllers/traces_controller.rb

index 2e3e6b8e63c640083d4b4abdf6e2c514d6c750cc..9dd82f8bbca4ac13462addb7c09f00ca901bceec 100644 (file)
@@ -117,7 +117,7 @@ class TracesController < ApplicationController
         do_create(params[:trace][:gpx_file], params[:trace][:tagstring],
                   params[:trace][:description], params[:trace][:visibility])
       rescue StandardError => ex
-        render :action => "new" unless @trace.valid?
+        render :action => "new" and return unless @trace.valid?
         logger.debug ex
       end