Method: Effective::CrudController::Paths#referer_redirect_path

Defined in:
app/controllers/concerns/effective/crud_controller/paths.rb

#referer_redirect_pathObject



56
57
58
59
60
61
62
63
64
# File 'app/controllers/concerns/effective/crud_controller/paths.rb', line 56

def referer_redirect_path
  url = request.referer.to_s

  return if (resource && resource.respond_to?(:destroyed?) && resource.destroyed? && url.include?("/#{resource.to_param}"))
  return if url.include?('duplicate_id=')
  return unless (Rails.application.routes.recognize_path(URI(url).path) rescue false)

  url
end