This plug integrates turbolinks into your phoenix application.
Because turbolinks makes an xhr requests it cannot update browser URL on redirects without help from backend.
And that's exactly what this plug does. After each redirect initiated by turbolinks it sets Turbolinks-Location
header to hint url.
- Add
turbolinks_plug
to your list of dependencies inmix.exs
:
```elixir
def deps do
[{:turbolinks_plug, "~> 0.1.0"}]
end
```
- Add plug to your pipeline in
web/router.ex
pipeline :browser do
...
plug TurbolinksPlug
end