How to branch the link destination to be displayed on the page according to the ** path name ** in ʻURL` of the page before the transition.
https:///www.example.com/userIf so, the pathname is
Applicable view file
<% if URI(request.referer.to_s).path == 'Path name' %> #Link destination when the previous page is the specified path <% else %> #Other links <% end %>
request.refererreturns a string.
to_sso that an error does not occur when a request is made with a numerical value (ʻinteger
) in ʻURL.
Ruby's ʻURI module``.
How to get all URLs and branch the link to be displayed on the page https://qiita.com/taka_571/items/9b1c82d8fcc602df8a1a