 
   plug Guardian.Plug.EnsureAuthenticated, %{handler: Core.Auth} when action in [:create, :update, :delete]
   plug Core.BodyParams, name: "article"
+  plug :find when action in [:update, :delete, :show]
 
   def index(conn, _params) do
     articles = Repo.all(Article)

    end
  end

  def show(conn, %{"id" => id}) do
    article = Repo.get!(Article, id)
    render(conn, "show.json", article: article)
  end

  def update(conn, %{"id" => id, "article" => article_params}) do
    article = Repo.get!(Article, id)
    changeset = Article.changeset(article, article_params)

    case Repo.update(changeset) do

  end

  def delete(conn, %{"id" => id}) do
    article = conn.assigns[:article]

    # Here we use delete! (with a bang) because we expect
    # it to always work (and if it does not, it will raise).
