Sha256: 7f731378772c148390f9c021e9030ecb09f73f3f38023dfa4d788281db7975a0

Contents?: true

Size: 416 Bytes

Versions: 19

Compression:

Stored size: 416 Bytes

Contents

module BMC::BackUrlConcern
  extend ActiveSupport::Concern

  private

  def default_back_url
  end

  def back_url
    url = [
      params[:back_url],
      request.referer,
      default_back_url,
      main_app.try(:root_path),
      "/",
    ].find(&:present?)

    uri = URI.parse(url)
    uri.host = nil
    uri.port = nil
    uri.scheme = nil
    uri.user = nil
    uri.password = nil
    uri.to_s
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bmc-1.6.1 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.6.0 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.5.1 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.5.0 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.4.3 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.4.2 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.4.1 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.4.0 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.3.5 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.3.4 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.3.3 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.3.2 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.3.1 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.3.0 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.2.1 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.2.0 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.1.0 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.0.1 app/controllers/concerns/bmc/back_url_concern.rb
bmc-1.0.0 app/controllers/concerns/bmc/back_url_concern.rb