Sha256: ea0cd9e78ee6ecf8113c64283247fe52af4dc3e786d54e39c72bea94a47b6c09

Contents?: true

Size: 678 Bytes

Versions: 57

Compression:

Stored size: 678 Bytes

Contents

module Cmor
  module UserArea
    module Controller
      module RedirectBackConcern
        extend ActiveSupport::Concern

        private

        def store_location
          self.original_location = request.url if request.get?
        end

        def redirect_back_or(url)
          redirect_to(original_location || url)
          clear_original_location
        end

        def clear_original_location
          session.delete(:original_location)
        end

        def original_location
          session[:original_location]
        end

        def original_location=(location)
          session[:original_location] = location
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
cmor_user_area-0.0.60.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.59.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.58.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.57.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.56.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.55.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.54.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.53.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.52.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.51.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.50.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.49.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.48.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.45.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.44.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.43.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.42.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.41.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.40.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb
cmor_user_area-0.0.39.pre app/concerns/cmor/user_area/controller/redirect_back_concern.rb