Sha256: b0cc4d19d1ef3379828d355125ecf3bf58177101940ab630d09316de289b9f42

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

module Trestle
  class Resource
    module Controller
      module Redirection
      protected
        def redirect_to_return_location(action, instance, default:)
          if admin.return_locations[action] && !dialog_request?
            location = instance_exec(instance, &admin.return_locations[action])

            case location
            when :back
              redirect_back fallback_location: default, turbolinks: false
            else
              redirect_to location, turbolinks: false
            end
          else
            redirect_to default, turbolinks: false
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trestle-0.9.8 app/controllers/concerns/trestle/resource/controller/redirection.rb
trestle-0.9.7 app/controllers/concerns/trestle/resource/controller/redirection.rb
trestle-0.9.6 app/controllers/concerns/trestle/resource/controller/redirection.rb
trestle-0.9.5 app/controllers/concerns/trestle/resource/controller/redirection.rb
trestle-0.9.4 app/controllers/concerns/trestle/resource/controller/redirection.rb
trestle-0.9.3 app/controllers/concerns/trestle/resource/controller/redirection.rb