<% page1 = request.request_uri %>
<% page2 = request.referer %>
Current page: <%= page1 %>
Previous page: <%= page2 %>
<% page2 = request.referer %>
Current page: <%= page1 %>
Previous page: <%= page2 %>
If different urls mean the same page, eg: (../admin = ../admin/ = ../admin/index = ..admin/index/), and maybe the id is unwanted too (../admin/show/8), so below is an alternative with control on which parameter is used.
<% page = "/" + request.path_parameters['controller'] + "/" + request.path_parameters['action'] %>
Page: <%= page %>
Page: <%= page %>
No comments:
Post a Comment