philomena/lib/philomena_web/controllers/image/favorites_controller.ex

11 lines
343 B
Elixir
Raw Normal View History

2019-12-04 05:14:56 +01:00
defmodule PhilomenaWeb.Image.FavoritesController do
use PhilomenaWeb, :controller
alias Philomena.Images.Image
plug :load_and_authorize_resource, model: Image, id_name: "image_id", persisted: true, preload: [faves: :user]
def index(conn, _params) do
render(conn, "index.html", layout: false, image: conn.assigns.image)
end
end