mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 23:08:00 +01:00
17 lines
321 B
Elixir
17 lines
321 B
Elixir
|
defmodule PhilomenaWeb.AdvertController do
|
||
|
use PhilomenaWeb, :controller
|
||
|
|
||
|
alias Philomena.Adverts
|
||
|
alias Philomena.Adverts.Advert
|
||
|
|
||
|
plug :load_resource, model: Advert
|
||
|
|
||
|
def show(conn, _params) do
|
||
|
advert = conn.assigns.advert
|
||
|
|
||
|
Adverts.click(advert)
|
||
|
|
||
|
conn
|
||
|
|> redirect(external: advert.link)
|
||
|
end
|
||
|
end
|