Sha256: bcfa0c4d2ae4337cd509a7dcf407da991bfa3f587bb124979b68ba4706b20cca

Contents?: true

Size: 376 Bytes

Versions: 17

Compression:

Stored size: 376 Bytes

Contents

module Controller
  module RedirectBackConcern
    extend ActiveSupport::Concern

    def store_location
      session[:original_location] = request.url if request.get?
    end

    def redirect_back_or(url)
      redirect_to(session[:original_location] || url)
      clear_return_to
    end

    def clear_return_to
      session.delete(:original_location)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ecm_user_area2-4.0.2 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-4.0.1 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.1.2 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.1.1 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.1.0 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.0.3 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.0.2 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.0.1 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-3.0.0 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-2.3.0 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-2.2.0 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-2.0.0 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-1.2.10 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-1.2.9 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-1.2.8 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-1.2.6 app/concerns/controller/redirect_back_concern.rb
ecm_user_area2-1.0.3 app/concerns/controller/redirect_back_concern.rb