mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-04-22 04:01:51 +09:00
keep original functionality but redirect to root path if referrer equals current url
This commit is contained in:
@@ -23,7 +23,9 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def link_back
|
||||
link_back_to request.referrer || root_path
|
||||
back_url = request.referrer
|
||||
back_url = root_path if back_url.nil? || back_url == request.url
|
||||
link_back_to back_url
|
||||
end
|
||||
|
||||
def link_back_to(destination)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<% content_for :nav do %>
|
||||
<div class="flex-item-justify-start">
|
||||
<%= link_back_to_last_room_visited %>
|
||||
<%= link_back %>
|
||||
</div>
|
||||
|
||||
<div class="flex-item-justify-end">
|
||||
|
||||
Reference in New Issue
Block a user