Sha256: 1a52c37549e20c9d8f2cab9dfe89752ec7a04757be3408781662c61000d0bbb7
Contents?: true
Size: 656 Bytes
Versions: 42
Compression:
Stored size: 656 Bytes
Contents
module Locomotive module Concerns module StoreLocationController extend ActiveSupport::Concern included do helper_method :last_saved_location end private def store_location if request.get? && params[:_location].blank? session[:return_to] = request.fullpath end end def last_saved_location(default) session[:return_to] || default end def last_saved_location!(default) session.delete(:return_to) || default end def redirect_back_or_default(default) redirect_to(last_saved_location!(default)) end end end end
Version data entries
42 entries across 42 versions & 1 rubygems