mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-22 08:58:00 +01:00
16 lines
323 B
Elixir
16 lines
323 B
Elixir
defmodule PhilomenaWeb.AdvertController do
|
|
use PhilomenaWeb, :controller
|
|
|
|
alias Philomena.Adverts.Advert
|
|
alias Philomena.Adverts
|
|
|
|
plug :load_resource, model: Advert
|
|
|
|
def show(conn, _params) do
|
|
advert = conn.assigns.advert
|
|
|
|
Adverts.record_click(advert)
|
|
|
|
redirect(conn, external: advert.link)
|
|
end
|
|
end
|