Sha256: e621e28f5dc5e731ea5f13604de504438e622599cec749ae327494654e0151cd

Contents?: true

Size: 314 Bytes

Versions: 1

Compression:

Stored size: 314 Bytes

Contents

module JumpBack
  
  def save_referer
    session[:jump_back_stored_referer] ||= request.referer
  end

  def return_to_referer(path=root_path)
    session[:jump_back_stored_referer] ? redirect_to(clear_referer) : redirect_to(path)
  end

  def clear_referer
    session.delete(:jump_back_stored_referer)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jump_back-0.1.1 lib/jump_back/return_to_referer.rb