Created
February 3, 2020 16:14
-
-
Save TobyRet/d79a69e3bf5f974ed8c9fb2b633f1927 to your computer and use it in GitHub Desktop.
Back link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#courses/show.html.erb | |
<% if permitted_referrer? %> | |
<%= content_for(:before_content) do %> | |
<%= govuk_back_link_to(build_back_link, "Back to search results") %> | |
<% end %> | |
<% end %> | |
# | |
def govuk_back_link_to(url, link_text = "Back") | |
govuk_link_to(link_text, url, class: "govuk-back-link", data: {qa: "page-back"}) | |
end | |
def permitted_referrer? | |
referrer_host_and_path = [dark magic] | |
referrer_host_and_path == Settings.search_and_compare_ui.base_url || | |
referrer_host_and_path == Settings.find_teach_training.base_url | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment