Previews

No matching results.

Pages

No matching results.

x
1
<a class="btn" target="_blank" data-controller="back-navigation" data-back-navigation-fallback-destination-value="/lookbook/inspect/back_navigation" href="">Go back</a>
1
<%= link_to "Go back", "", class: "btn", target: "_blank", data: { controller: "back-navigation", back_navigation_fallback_destination_value: lookbook.lookbook_inspect_path("back_navigation") } %>
CSS is not required or multiple files are needed, check the notes.
1
2
3
4
5
6
7
8
9
10
11
12
13
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static values = { fallbackDestination: String }
connect() {
if (history.state.turbo?.restorationIndex > 0) {
this.element.href = "javascript:history.back()"
} else {
this.element.href = this.fallbackDestinationValue
}
}
}